Add home and end key support

This commit is contained in:
Joseph Lyons 2022-12-26 00:24:26 -05:00
parent 04e053a216
commit 21a0df406f
2 changed files with 18 additions and 0 deletions

View file

@ -47,6 +47,8 @@ pub fn key_to_native(key: &str) -> Cow<str> {
"right" => NSRightArrowFunctionKey,
"pageup" => NSPageUpFunctionKey,
"pagedown" => NSPageDownFunctionKey,
"home" => NSHomeFunctionKey,
"end" => NSEndFunctionKey,
"delete" => NSDeleteFunctionKey,
"f1" => NSF1FunctionKey,
"f2" => NSF2FunctionKey,
@ -258,6 +260,8 @@ unsafe fn parse_keystroke(native_event: id) -> Keystroke {
Some(NSRightArrowFunctionKey) => "right".to_string(),
Some(NSPageUpFunctionKey) => "pageup".to_string(),
Some(NSPageDownFunctionKey) => "pagedown".to_string(),
Some(NSHomeFunctionKey) => "home".to_string(),
Some(NSEndFunctionKey) => "end".to_string(),
Some(NSDeleteFunctionKey) => "delete".to_string(),
Some(NSF1FunctionKey) => "f1".to_string(),
Some(NSF2FunctionKey) => "f2".to_string(),