Sync CapsLock and NumLock status in legacy mode.

This commit is contained in:
Asura
2022-07-23 08:20:39 -07:00
parent b3b97ee69a
commit 1caee4e306
4 changed files with 34 additions and 26 deletions

View File

@@ -363,7 +363,6 @@ class Header: Reactor.Component {
}
event click $(menu#keyboard-options>li) (_, me) {
stdout.println(me.id);
if (me.id == "legacy") {
handler.save_keyboard_mode("legacy");
} else if (me.id == "map") {

View File

@@ -1105,7 +1105,7 @@ impl Handler {
key_event.modifiers.push(ControlKey::CapsLock.into());
}
if self.peer_platform() != "Mac OS" {
if get_key_state(enigo::Key::NumLock) && common::valid_for_numlock(&key_event) {
if get_key_state(enigo::Key::NumLock) {
key_event.modifiers.push(ControlKey::NumLock.into());
}
}