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": [
|
"default": [
|
||||||
{
|
{
|
||||||
"include": "shift",
|
"include": "shift",
|
||||||
"exclude": "",
|
"exclude": "mouse0",
|
||||||
"types": {
|
"types": {
|
||||||
"mouse": true,
|
"mouse": true,
|
||||||
"touch": false,
|
"touch": false,
|
||||||
|
@ -550,7 +550,7 @@ class OptionsUtil {
|
|||||||
}
|
}
|
||||||
scanningInputs.push({
|
scanningInputs.push({
|
||||||
include: modifierInput,
|
include: modifierInput,
|
||||||
exclude: '',
|
exclude: 'mouse0',
|
||||||
types: {mouse: true, touch: false, pen: false},
|
types: {mouse: true, touch: false, pen: false},
|
||||||
options: createInputDefaultOptions()
|
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) {
|
static getActiveModifiers(event) {
|
||||||
const modifiers = new Set();
|
const modifiers = new Set();
|
||||||
if (event.altKey) { modifiers.add('alt'); }
|
if (event.altKey) { modifiers.add('alt'); }
|
||||||
|
@ -267,10 +267,6 @@ class TextScanner extends EventDispatcher {
|
|||||||
_onMouseMove(e) {
|
_onMouseMove(e) {
|
||||||
this._scanTimerClear();
|
this._scanTimerClear();
|
||||||
|
|
||||||
if (DocumentUtil.isMouseButtonDown(e, 'primary')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const inputInfo = this._getMatchingInputGroupFromEvent(e, 'mouse');
|
const inputInfo = this._getMatchingInputGroupFromEvent(e, 'mouse');
|
||||||
if (inputInfo === null) { return; }
|
if (inputInfo === null) { return; }
|
||||||
|
|
||||||
@ -286,7 +282,7 @@ class TextScanner extends EventDispatcher {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DocumentUtil.isMouseButtonDown(e, 'primary')) {
|
if (e.button === 0) { // Primary
|
||||||
this._scanTimerClear();
|
this._scanTimerClear();
|
||||||
this.clearSelection(false);
|
this.clearSelection(false);
|
||||||
}
|
}
|
||||||
|
@ -319,7 +319,7 @@ function createProfileOptionsUpdatedTestData1() {
|
|||||||
inputs: [
|
inputs: [
|
||||||
{
|
{
|
||||||
include: 'shift',
|
include: 'shift',
|
||||||
exclude: '',
|
exclude: 'mouse0',
|
||||||
types: {
|
types: {
|
||||||
mouse: true,
|
mouse: true,
|
||||||
touch: false,
|
touch: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user