Skip to content

Commit

Permalink
Handle some more numpad keys
Browse files Browse the repository at this point in the history
  • Loading branch information
hhirtz committed Feb 2, 2024
1 parent ef2d772 commit cc1c8e4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/window/keyboard_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,19 @@ impl KeyboardManager {
KeyCode::NumpadSubtract => Some("kMinus"),
KeyCode::NumpadAdd => Some("kPlus"),
KeyCode::NumpadEnter => Some("kEnter"),
KeyCode::NumpadDecimal => Some("kDel"),
KeyCode::NumpadEqual => Some("kEqual"),
KeyCode::NumpadDecimal | KeyCode::NumpadComma => {
if is_numlock_key {
let numlock_str = match key_event.logical_key.as_ref() {
Key::Character(",") => Some("kComma"),
Key::Character(".") => Some("kPoint"),
_ => key_event.logical_key.to_text(),
};
numlock_str
} else {
Some("kDel")
}
}
KeyCode::Numpad9 => {
KeyboardManager::handle_numpad_numkey(is_numlock_key, "k9", "kPageUp")
}
Expand Down

0 comments on commit cc1c8e4

Please sign in to comment.