Scanning mouse button fixes (#866)
* Move mouse0 blocking during mousemove into options * Update primary button detection
This commit is contained in:
parent
f18c28e519
commit
c1b5976394
@ -343,7 +343,7 @@
|
||||
"default": [
|
||||
{
|
||||
"include": "shift",
|
||||
"exclude": "",
|
||||
"exclude": "mouse0",
|
||||
"types": {
|
||||
"mouse": true,
|
||||
"touch": false,
|
||||
|
@ -550,7 +550,7 @@ class OptionsUtil {
|
||||
}
|
||||
scanningInputs.push({
|
||||
include: modifierInput,
|
||||
exclude: '',
|
||||
exclude: 'mouse0',
|
||||
types: {mouse: true, touch: false, pen: false},
|
||||
options: createInputDefaultOptions()
|
||||
});
|
||||
|
@ -169,16 +169,6 @@ class DocumentUtil {
|
||||
}
|
||||
}
|
||||
|
||||
static isMouseButtonDown(mouseEvent, button) {
|
||||
const mouseEventButtons = mouseEvent.buttons;
|
||||
switch (button) {
|
||||
case 'primary': return (mouseEventButtons & 0x1) !== 0x0;
|
||||
case 'secondary': return (mouseEventButtons & 0x2) !== 0x0;
|
||||
case 'auxiliary': return (mouseEventButtons & 0x4) !== 0x0;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
static getActiveModifiers(event) {
|
||||
const modifiers = new Set();
|
||||
if (event.altKey) { modifiers.add('alt'); }
|
||||
|
@ -267,10 +267,6 @@ class TextScanner extends EventDispatcher {
|
||||
_onMouseMove(e) {
|
||||
this._scanTimerClear();
|
||||
|
||||
if (DocumentUtil.isMouseButtonDown(e, 'primary')) {
|
||||
return;
|
||||
}
|
||||
|
||||
const inputInfo = this._getMatchingInputGroupFromEvent(e, 'mouse');
|
||||
if (inputInfo === null) { return; }
|
||||
|
||||
@ -286,7 +282,7 @@ class TextScanner extends EventDispatcher {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (DocumentUtil.isMouseButtonDown(e, 'primary')) {
|
||||
if (e.button === 0) { // Primary
|
||||
this._scanTimerClear();
|
||||
this.clearSelection(false);
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ function createProfileOptionsUpdatedTestData1() {
|
||||
inputs: [
|
||||
{
|
||||
include: 'shift',
|
||||
exclude: '',
|
||||
exclude: 'mouse0',
|
||||
types: {
|
||||
mouse: true,
|
||||
touch: false,
|
||||
|
Loading…
Reference in New Issue
Block a user