mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 01:10:12 +02:00
Refactor ZenKeyboardShortcuts to add support for accelerator keys in constructor
This commit is contained in:
parent
e629fdfaa0
commit
05d658c6bc
1 changed files with 5 additions and 3 deletions
|
@ -115,13 +115,14 @@ class KeyShortcutModifiers {
|
|||
#meta = false;
|
||||
#accel = false;
|
||||
|
||||
constructor(ctrl, alt, shift, meta, accel) {
|
||||
constructor(ctrl, alt, shift, meta, accel, fromXHTML = false) {
|
||||
this.#control = ctrl;
|
||||
this.#alt = alt;
|
||||
this.#shift = shift;
|
||||
this.#meta = meta;
|
||||
this.#accel = accel;
|
||||
if (AppConstants.platform != 'macosx') {
|
||||
|
||||
if (AppConstants.platform != 'macosx' || !fromXHTML) {
|
||||
// Replace control with accel, to make it more consistent
|
||||
this.#accel = ctrl || accel;
|
||||
this.#control = false;
|
||||
|
@ -152,7 +153,8 @@ class KeyShortcutModifiers {
|
|||
modifiers.includes('alt'),
|
||||
modifiers.includes('shift'),
|
||||
modifiers.includes('meta'),
|
||||
modifiers.includes('accel')
|
||||
modifiers.includes('accel'),
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue