Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise Key, KeyCode enums #3143

Merged
merged 11 commits into from
Oct 19, 2023
3 changes: 3 additions & 0 deletions src/platform_impl/windows/keyboard_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ impl LayoutCache {
}
let keycode = match PhysicalKey::from_scancode(scancode) {
PhysicalKey::Code(code) => code,
// TODO: validate that we can skip on unidentified keys (probably never occurs?)
_ => continue,
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@notgull could you check this please? (Also 52 lines below.)

if !is_numpad_specific(vk as VIRTUAL_KEY) && NUMPAD_KEYCODES.contains(&keycode) {
Expand Down Expand Up @@ -389,6 +390,7 @@ impl LayoutCache {
let native_code = NativeKey::Windows(vk as VIRTUAL_KEY);
let key_code = match PhysicalKey::from_scancode(scancode) {
PhysicalKey::Code(code) => code,
// TODO: validate that we can skip on unidentified keys (probably never occurs?)
_ => continue,
};
// Let's try to get the key from just the scancode and vk
Expand Down Expand Up @@ -741,6 +743,7 @@ fn keycode_to_vkey(keycode: KeyCode, hkl: u64) -> VIRTUAL_KEY {
KeyCode::F33 => 0,
KeyCode::F34 => 0,
KeyCode::F35 => 0,
// TODO: validate removal of KeyCode::Unidentified(_) => 0,
dhardy marked this conversation as resolved.
Show resolved Hide resolved
_ => 0,
}
}
Expand Down
Loading