mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Fixed keyboard shortcuts for Shift + [N]
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user