macos: populate caps lock state, report num lock presses
macos doesn't have a num lock concept, so there is no num lock state reported in modifiers. wezterm doesn't emulate that state because it cannot guarantee to observe all key presses and correctly track it.
This commit is contained in:
1 file changed
+4
@@ -383,6 +383,7 @@ fn function_key_to_keycode(function_key: char) -> KeyCode {
|
||||
appkit::NSEndFunctionKey => KeyCode::End,
|
||||
appkit::NSPageUpFunctionKey => KeyCode::PageUp,
|
||||
appkit::NSPageDownFunctionKey => KeyCode::PageDown,
|
||||
appkit::NSClearLineFunctionKey => KeyCode::NumLock,
|
||||
value @ appkit::NSF1FunctionKey..=appkit::NSF35FunctionKey => {
|
||||
KeyCode::Function((value - appkit::NSF1FunctionKey + 1) as u8)
|
||||
}
|
||||
@@ -1679,6 +1680,9 @@ fn key_modifiers(flags: NSEventModifierFlags) -> Modifiers {
|
||||
if flags.contains(NSEventModifierFlags::NSCommandKeyMask) {
|
||||
mods |= Modifiers::SUPER;
|
||||
}
|
||||
if flags.bits() & (1 << 16) != 0 {
|
||||
mods |= Modifiers::CAPS_LOCK;
|
||||
}
|
||||
|
||||
mods
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user