summaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/options.js15
-rw-r--r--ext/bg/js/settings/scan-inputs-controller.js5
2 files changed, 17 insertions, 3 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index ac42fc09..e61e1c48 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -491,7 +491,7 @@ class OptionsUtil {
profileOptions.general.usePopupWindow = false;
profileOptions.scanning.hideDelay = 0;
- const {modifier, middleMouse} = profileOptions.scanning;
+ const {modifier, middleMouse, touchInputEnabled} = profileOptions.scanning;
const scanningInputs = [];
let modifierInput = '';
switch (modifier) {
@@ -507,12 +507,21 @@ class OptionsUtil {
}
scanningInputs.push({
include: modifierInput,
- exclude: ''
+ exclude: '',
+ types: {mouse: true, touch: false, pen: false}
});
if (middleMouse) {
scanningInputs.push({
include: 'mouse2',
- exclude: ''
+ exclude: '',
+ types: {mouse: true, touch: false, pen: false}
+ });
+ }
+ if (touchInputEnabled) {
+ scanningInputs.push({
+ include: '',
+ exclude: '',
+ types: {mouse: false, touch: true, pen: true}
});
}
profileOptions.scanning.inputs = scanningInputs;
diff --git a/ext/bg/js/settings/scan-inputs-controller.js b/ext/bg/js/settings/scan-inputs-controller.js
index 3b3945ff..3cd2b513 100644
--- a/ext/bg/js/settings/scan-inputs-controller.js
+++ b/ext/bg/js/settings/scan-inputs-controller.js
@@ -142,6 +142,11 @@ class ScanInputField {
this._eventListeners.on(this._includeInputField, 'change', this._onIncludeValueChange.bind(this));
this._eventListeners.on(this._excludeInputField, 'change', this._onExcludeValueChange.bind(this));
this._eventListeners.addEventListener(removeButton, 'click', this._onRemoveClick.bind(this));
+
+ for (const typeCheckbox of node.querySelectorAll('.scan-input-type-checkbox')) {
+ const {type} = typeCheckbox.dataset;
+ typeCheckbox.dataset.setting = `scanning.inputs[${this._index}].types.${type}`;
+ }
}
cleanup() {