mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-10 02:03:07 +08:00
fix(linux): Make F11 show up in menu as shortcut
This commit is contained in:
parent
288023639b
commit
0ecb388fa4
1 changed files with 4 additions and 2 deletions
|
@ -199,14 +199,16 @@ class ApplicationMenu
|
||||||
firstKeystroke = keystrokesByCommand[command]?[0]
|
firstKeystroke = keystrokesByCommand[command]?[0]
|
||||||
return null unless firstKeystroke
|
return null unless firstKeystroke
|
||||||
|
|
||||||
|
if /f\d+/.test(firstKeystroke)
|
||||||
|
firstKeystroke = firstKeystroke.toUpperCase()
|
||||||
|
|
||||||
modifiers = firstKeystroke.split('+')
|
modifiers = firstKeystroke.split('+')
|
||||||
modReplacement = if process.platform is "darwin" then "Command" else "Ctrl"
|
|
||||||
key = modifiers.pop()
|
key = modifiers.pop()
|
||||||
|
|
||||||
modifiers = modifiers.map (modifier) ->
|
modifiers = modifiers.map (modifier) ->
|
||||||
modifier.replace(/shift/ig, "Shift")
|
modifier.replace(/shift/ig, "Shift")
|
||||||
.replace(/command/ig, "Command")
|
.replace(/command/ig, "Command")
|
||||||
.replace(/mod/ig, modReplacement)
|
.replace(/mod/ig, "CmdOrCtrl")
|
||||||
.replace(/ctrl/ig, "Ctrl")
|
.replace(/ctrl/ig, "Ctrl")
|
||||||
.replace(/alt/ig, "Alt")
|
.replace(/alt/ig, "Alt")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue