From c1b59763941a74367b81e9b8329319f1ede72317 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 26 Sep 2020 17:51:52 -0400 Subject: Scanning mouse button fixes (#866) * Move mouse0 blocking during mousemove into options * Update primary button detection --- ext/mixed/js/document-util.js | 10 ---------- ext/mixed/js/text-scanner.js | 6 +----- 2 files changed, 1 insertion(+), 15 deletions(-) (limited to 'ext/mixed/js') diff --git a/ext/mixed/js/document-util.js b/ext/mixed/js/document-util.js index d448fc3c..90add8f9 100644 --- a/ext/mixed/js/document-util.js +++ b/ext/mixed/js/document-util.js @@ -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'); } diff --git a/ext/mixed/js/text-scanner.js b/ext/mixed/js/text-scanner.js index f38ca1de..aacc683a 100644 --- a/ext/mixed/js/text-scanner.js +++ b/ext/mixed/js/text-scanner.js @@ -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); } -- cgit v1.2.3