Use linux scancode values for KeyCodeExtScancode

Old winit was using linux scancodes, so this should make it backward
compatible with itself.
This commit is contained in:
Kirill Chibisov 2023-05-29 13:48:12 +03:00 committed by GitHub
parent b5af6bb266
commit 035eebb19a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 12 deletions

View file

@ -656,11 +656,11 @@ impl KeyEventExtModifierSupplement for KeyEvent {
impl KeyCodeExtScancode for KeyCode {
fn from_scancode(scancode: u32) -> KeyCode {
common::keymap::raw_keycode_to_keycode(scancode)
common::keymap::scancode_to_keycode(scancode)
}
fn to_scancode(self) -> Option<u32> {
common::keymap::keycode_to_raw(self)
common::keymap::keycode_to_scancode(self)
}
}