aboutsummaryrefslogtreecommitdiff
path: root/ext/js/input/hotkey-handler.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-18 08:11:47 -0500
committerGitHub <noreply@github.com>2024-02-18 13:11:47 +0000
commitcfc65c31313731dfa0d36c2eceaca35e9d50992f (patch)
treeec96ec7ab1c3dae559fe5d7930c186347fb64a25 /ext/js/input/hotkey-handler.js
parent6cf38229b54efbbc3ae7bc174c3999f9dfa7b1d2 (diff)
Refactor DocumentUtil (#706)
* Refactor DocumentUtil * Isolate suppression
Diffstat (limited to 'ext/js/input/hotkey-handler.js')
-rw-r--r--ext/js/input/hotkey-handler.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/js/input/hotkey-handler.js b/ext/js/input/hotkey-handler.js
index 6d7d3d7a..818c0155 100644
--- a/ext/js/input/hotkey-handler.js
+++ b/ext/js/input/hotkey-handler.js
@@ -18,7 +18,7 @@
import {EventDispatcher} from '../core/event-dispatcher.js';
import {EventListenerCollection} from '../core/event-listener-collection.js';
-import {DocumentUtil} from '../dom/document-util.js';
+import {getActiveModifiers, isInputElementFocused} from '../dom/document-util.js';
/**
* Class which handles hotkey events and actions.
@@ -173,7 +173,7 @@ export class HotkeyHandler extends EventDispatcher {
_onKeyDown(event) {
const hotkeyInfo = this._hotkeys.get(event.code);
if (typeof hotkeyInfo !== 'undefined') {
- const eventModifiers = DocumentUtil.getActiveModifiers(event);
+ const eventModifiers = getActiveModifiers(event);
if (this._invokeHandlers(eventModifiers, hotkeyInfo, event.key)) {
event.preventDefault();
return;
@@ -269,7 +269,7 @@ export class HotkeyHandler extends EventDispatcher {
_isHotkeyPermitted(modifiers, key) {
return !(
(modifiers.length === 0 || (modifiers.length === 1 && modifiers[0] === 'shift')) &&
- DocumentUtil.isInputElementFocused() &&
+ isInputElementFocused() &&
this._isKeyCharacterInput(key)
);
}