aboutsummaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/mixed/js/document-util.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/mixed/js/document-util.js b/ext/mixed/js/document-util.js
index 58b0c759..d448fc3c 100644
--- a/ext/mixed/js/document-util.js
+++ b/ext/mixed/js/document-util.js
@@ -312,12 +312,14 @@ class DocumentUtil {
}
static _getActiveButtons(event, set) {
- const {buttons} = event;
- if (typeof buttons === 'number') {
+ let {buttons} = event;
+ if (typeof buttons === 'number' && buttons > 0) {
for (let i = 0; i < 6; ++i) {
const buttonFlag = (1 << i);
if ((buttons & buttonFlag) !== 0) {
set.add(`mouse${i}`);
+ buttons &= ~buttonFlag;
+ if (buttons === 0) { break; }
}
}
}