Fixed keyboard shortcuts for Shift + [N]

This commit is contained in:
mr. M
2024-10-19 19:10:57 +02:00
parent 83b077d5f3
commit 07cd774619

View File

@@ -729,19 +729,6 @@ var zenMissingKeyboardShortcutL10n = {
key_redo: 'zen-key-redo',
};
var zenKeycodeFixes = {
Digit0: '0',
Digit1: '1',
Digit2: '2',
Digit3: '3',
Digit4: '4',
Digit5: '5',
Digit6: '6',
Digit7: '7',
Digit8: '8',
Digit9: '9',
};
var gZenCKSSettings = {
async init() {
await this._initializeCKS();
@@ -892,14 +879,6 @@ var gZenCKSSettings = {
this._currentActionID = null;
},
getShortcutFromEvent(event) {
const code = event.code;
if (code.startsWith('Key')) {
return code.replace('Key', '');
}
return event.key;
},
//TODO Check for duplicates
async _handleKeyDown(event) {
if (!this._currentActionID || document.hidden) {
@@ -916,7 +895,7 @@ var gZenCKSSettings = {
// This is because on some OSs (windows/macos mostly) the key is not the same as the keycode
// e.g. CTRL+ALT+3 may be displayed as the euro sign
let shortcut = zenKeycodeFixes[event.code] ?? this.getShortcutFromEvent(event);
let shortcut = event.key;
shortcut = shortcut.replace(/Ctrl|Control|Shift|Alt|Option|Cmd|Meta/, ''); // Remove all modifiers