diff --git a/package.json b/package.json index 6fd7f36..f1cd21a 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,10 @@ "lodash-es": "^4.17.21", "marked": "^3.0.8", "mux.js": "^5.14.1", + "psychic-tiny-keys": "https://git.maharshi.ninja/root/psychic-tiny-keys/archive/v0.0.1.tar.gz", "register-service-worker": "^1.7.2", "sass-loader": "^10", "shaka-player": "^3.2.1", - "tinykeys": "^1.2.0", "vue": "^2.6.14", "vue-i18n": "^8.26.7", "vue-json-viewer": "^2.2.20", diff --git a/src/components/Player.vue b/src/components/Player.vue index 661a69a..a5d9f5c 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -38,7 +38,7 @@ import shaka from 'shaka-player/dist/shaka-player.ui.js' import 'shaka-player/dist/controls.css' import { DashUtils } from '@/tools/DashUtils' -import { setupKeybindings } from '@/plugins/keybindings' +import { setupKeybindings } from 'psychic-tiny-keys' window.muxjs = muxjs diff --git a/src/plugins/keybindings.js b/src/plugins/keybindings.js deleted file mode 100644 index 52b901d..0000000 --- a/src/plugins/keybindings.js +++ /dev/null @@ -1,19 +0,0 @@ -import tinykeys from 'tinykeys' - -export function setupKeybindings (el, bindings, ...extra) { - const newBindings = {} - for (const [k, f] of Object.entries(bindings)) { - newBindings[k] = (ev, ...args) => { - const active = ev.target - const enteringText = active instanceof HTMLElement && - (active.isContentEditable || - active.tagName === 'INPUT' || - active.tagName === 'TEXTAREA' || - active.tagName === 'SELECT' - ) - if (!enteringText) return f(ev, ...args) - } - } - - return tinykeys(el, newBindings, ...extra) -} diff --git a/src/routes/SearchMenu.vue b/src/routes/SearchMenu.vue index e5e15e3..b09220d 100644 --- a/src/routes/SearchMenu.vue +++ b/src/routes/SearchMenu.vue @@ -17,7 +17,7 @@