Convert function keys to the correct macOS codes for menu items

This commit is contained in:
Max Brunsfeld 2022-05-19 17:37:46 -07:00
parent df4cfa56cf
commit 21862faa58
2 changed files with 31 additions and 3 deletions

View file

@ -1,4 +1,4 @@
use super::{BoolExt as _, Dispatcher, FontSystem, Window};
use super::{event::key_to_native, BoolExt as _, Dispatcher, FontSystem, Window};
use crate::{
executor, keymap,
platform::{self, CursorStyle},
@ -165,7 +165,7 @@ impl MacForegroundPlatform {
.initWithTitle_action_keyEquivalent_(
ns_string(name),
selector("handleGPUIMenuItem:"),
ns_string(&keystroke.key),
ns_string(key_to_native(&keystroke.key).as_ref()),
)
.autorelease();
item.setKeyEquivalentModifierMask_(mask);