From 5e6e6bdd84c22147bff7c19471e86861e6391b6c Mon Sep 17 00:00:00 2001 From: Tom Crouch Date: Mon, 13 May 2024 22:38:41 +0100 Subject: [PATCH] Add function keys 13-20 --- src/macos/keycodes.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/macos/keycodes.rs b/src/macos/keycodes.rs index eeb6f98e..9dc2e98d 100644 --- a/src/macos/keycodes.rs +++ b/src/macos/keycodes.rs @@ -24,6 +24,14 @@ const F6: CGKeyCode = 97; const F7: CGKeyCode = 98; const F8: CGKeyCode = 100; const F9: CGKeyCode = 101; +const F13: CGKeyCode = 105; +const F14: CGKeyCode = 107; +const F15: CGKeyCode = 113; +const F16: CGKeyCode = 106; +const F17: CGKeyCode = 64; +const F18: CGKeyCode = 79; +const F19: CGKeyCode = 80; +const F20: CGKeyCode = 90; const FUNCTION: CGKeyCode = 63; const LEFT_ARROW: CGKeyCode = 123; const META_LEFT: CGKeyCode = 55; @@ -105,6 +113,14 @@ pub fn code_from_key(key: Key) -> Option { Key::F7 => Some(F7), Key::F8 => Some(F8), Key::F9 => Some(F9), + Key::F13 => Some(F13), + Key::F14 => Some(F14), + Key::F15 => Some(F15), + Key::F16 => Some(F16), + Key::F17 => Some(F17), + Key::F18 => Some(F18), + Key::F19 => Some(F19), + Key::F20 => Some(F20), Key::LeftArrow => Some(LEFT_ARROW), Key::MetaLeft => Some(META_LEFT), Key::MetaRight => Some(META_RIGHT), @@ -189,6 +205,14 @@ pub fn key_from_code(code: CGKeyCode) -> Key { F7 => Key::F7, F8 => Key::F8, F9 => Key::F9, + F13 => Key::F13, + F14 => Key::F14, + F15 => Key::F15, + F16 => Key::F16, + F17 => Key::F17, + F18 => Key::F18, + F19 => Key::F19, + F20 => Key::F20, LEFT_ARROW => Key::LeftArrow, META_LEFT => Key::MetaLeft, META_RIGHT => Key::MetaRight,