From 9ebe21394a8c44707f4a48a588c3de5a0f429515 Mon Sep 17 00:00:00 2001 From: Teddytrombone Date: Mon, 6 Jan 2025 15:58:53 +0100 Subject: [PATCH 1/2] Add missing function keys F13-F24 to linux implementation --- src/platform_impl/linux/keyboard.rs | 12 ++++++++++++ src/platform_impl/linux/keycode.rs | 24 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/src/platform_impl/linux/keyboard.rs b/src/platform_impl/linux/keyboard.rs index 73ca753ee..ea86312ad 100644 --- a/src/platform_impl/linux/keyboard.rs +++ b/src/platform_impl/linux/keyboard.rs @@ -60,6 +60,18 @@ pub(crate) fn raw_key_to_key(gdk_key: RawKey) -> Option> { F10 => Some(Key::F10), F11 => Some(Key::F11), F12 => Some(Key::F12), + F13 => Some(Key::F13), + F14 => Some(Key::F14), + F15 => Some(Key::F15), + F16 => Some(Key::F16), + F17 => Some(Key::F17), + F18 => Some(Key::F18), + F19 => Some(Key::F19), + F20 => Some(Key::F20), + F21 => Some(Key::F21), + F22 => Some(Key::F22), + F23 => Some(Key::F23), + F24 => Some(Key::F24), Print => Some(Key::PrintScreen), Scroll_Lock => Some(Key::ScrollLock), diff --git a/src/platform_impl/linux/keycode.rs b/src/platform_impl/linux/keycode.rs index 49f4c7068..e63e6c951 100644 --- a/src/platform_impl/linux/keycode.rs +++ b/src/platform_impl/linux/keycode.rs @@ -118,6 +118,18 @@ pub fn keycode_to_scancode(code: KeyCode) -> Option { KeyCode::F10 => Some(0x004C), KeyCode::F11 => Some(0x005F), KeyCode::F12 => Some(0x0060), + KeyCode::F13 => Some(0x00BF), + KeyCode::F14 => Some(0x00C0), + KeyCode::F15 => Some(0x00C1), + KeyCode::F16 => Some(0x00C2), + KeyCode::F17 => Some(0x00C3), + KeyCode::F18 => Some(0x00C4), + KeyCode::F19 => Some(0x00C5), + KeyCode::F20 => Some(0x00C6), + KeyCode::F21 => Some(0x00C7), + KeyCode::F22 => Some(0x00C8), + KeyCode::F23 => Some(0x00C9), + KeyCode::F24 => Some(0x00CA), KeyCode::PrintScreen => Some(0x006B), KeyCode::ScrollLock => Some(0x004E), KeyCode::Pause => Some(0x007F), @@ -295,6 +307,18 @@ pub fn keycode_from_scancode(scancode: u32) -> KeyCode { 0x00B3 => KeyCode::MediaSelect, 0x00B4 => KeyCode::BrowserHome, 0x00B5 => KeyCode::BrowserRefresh, + 0x00BF => KeyCode::F13, + 0x00C0 => KeyCode::F14, + 0x00C1 => KeyCode::F15, + 0x00C2 => KeyCode::F16, + 0x00C3 => KeyCode::F17, + 0x00C4 => KeyCode::F18, + 0x00C5 => KeyCode::F19, + 0x00C6 => KeyCode::F20, + 0x00C7 => KeyCode::F21, + 0x00C8 => KeyCode::F22, + 0x00C9 => KeyCode::F23, + 0x00CA => KeyCode::F24, 0x00E1 => KeyCode::BrowserSearch, _ => KeyCode::Unidentified(NativeKeyCode::Gtk(scancode as u16)), } From 43a832f75191fb540ef2b5784b2c9bcd77351637 Mon Sep 17 00:00:00 2001 From: Teddytrombone Date: Mon, 6 Jan 2025 16:03:12 +0100 Subject: [PATCH 2/2] Added change file --- .changes/fix-linux-missing-function-keys.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changes/fix-linux-missing-function-keys.md diff --git a/.changes/fix-linux-missing-function-keys.md b/.changes/fix-linux-missing-function-keys.md new file mode 100644 index 000000000..548b58ae8 --- /dev/null +++ b/.changes/fix-linux-missing-function-keys.md @@ -0,0 +1,5 @@ +--- +"tao": patch +--- + +Add missing function keys F13-F24 to linux implementation