mirror of
https://github.com/SoPat712/videospeed.git
synced 2025-08-21 18:08:46 -04:00
Merge pull request #533 from thewheat/show-hide-controller-disable-website-keybinds
Add ability to disable website keybindings for show/hide controller (Fixes: #526)
This commit is contained in:
14
inject.js
14
inject.js
@@ -92,6 +92,17 @@
|
||||
tc.settings.controllerOpacity = Number(storage.controllerOpacity);
|
||||
tc.settings.blacklist = String(storage.blacklist);
|
||||
|
||||
// ensure that there is a "display" binding (for upgrades from versions that had it as a separate binding)
|
||||
if (tc.settings.keyBindings.filter(x => x.action == "display").length == 0) {
|
||||
tc.settings.keyBindings.push({
|
||||
action: "display",
|
||||
key: Number(storage.displayKeyCode) || 86,
|
||||
value: 0,
|
||||
force: false,
|
||||
predefined: true
|
||||
}); // default V
|
||||
}
|
||||
|
||||
initializeWhenReady(document);
|
||||
});
|
||||
|
||||
@@ -362,9 +373,6 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
if (keyCode == tc.settings.displayKeyCode) {
|
||||
runAction('display', document, true)
|
||||
}
|
||||
var item = tc.settings.keyBindings.find(item => item.key === keyCode);
|
||||
if (item) {
|
||||
runAction(item.action, document, item.value);
|
||||
|
Reference in New Issue
Block a user