aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/keyboard-mouse-input-field.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-09-08 10:53:41 -0400
committerGitHub <noreply@github.com>2020-09-08 10:53:41 -0400
commit36fc5abae543840484b3d8f7abff85f57de66ada (patch)
treed8ce5b59ca26e8b91957989a775cb75a76c3d44a /ext/bg/js/settings/keyboard-mouse-input-field.js
parent0a5e832dfddcc6184410e8836cc8dea030457486 (diff)
Modifier key refactor (#784)
* Add functions for getting keyboard key information * Use os + DocumentUtil to get modifier key names * Remove keyboard modifier info from environment info
Diffstat (limited to 'ext/bg/js/settings/keyboard-mouse-input-field.js')
-rw-r--r--ext/bg/js/settings/keyboard-mouse-input-field.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/bg/js/settings/keyboard-mouse-input-field.js b/ext/bg/js/settings/keyboard-mouse-input-field.js
index d1dc76e0..b1530c1b 100644
--- a/ext/bg/js/settings/keyboard-mouse-input-field.js
+++ b/ext/bg/js/settings/keyboard-mouse-input-field.js
@@ -20,18 +20,18 @@
*/
class KeyboardMouseInputField extends EventDispatcher {
- constructor(inputNode, mouseButton, inputNameMap, keySeparator) {
+ constructor(inputNode, mouseButton, os) {
super();
this._inputNode = inputNode;
- this._keySeparator = keySeparator;
+ this._mouseButton = mouseButton;
+ this._keySeparator = ' + ';
+ this._inputNameMap = new Map(DocumentUtil.getModifierKeys(os));
this._keyPriorities = new Map([
['meta', -4],
['ctrl', -3],
['alt', -2],
['shift', -1]
]);
- this._mouseButton = mouseButton;
- this._inputNameMap = inputNameMap;
this._mouseInputNamePattern = /^mouse(\d+)$/;
this._eventListeners = new EventListenerCollection();
this._value = '';