Skip to content

Commit

Permalink
Add function keys 13-20
Browse files Browse the repository at this point in the history
  • Loading branch information
tcrouch committed May 14, 2024
1 parent 4cff110 commit 5e6e6bd
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/macos/keycodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -105,6 +113,14 @@ pub fn code_from_key(key: Key) -> Option<CGKeyCode> {
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),
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 5e6e6bd

Please sign in to comment.