Merge pull request #1274 from zed-industries/fix-enter-numpad

Support hitting enter on numpad
This commit is contained in:
Antonio Scandurra 2022-07-04 10:08:47 +02:00 committed by GitHub
commit 582185b8cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -248,6 +248,7 @@ unsafe fn get_key_text(
use cocoa::appkit::*;
const BACKSPACE_KEY: u16 = 0x7f;
const ENTER_KEY: u16 = 0x0d;
const NUMPAD_ENTER_KEY: u16 = 0x03;
const ESCAPE_KEY: u16 = 0x1b;
const TAB_KEY: u16 = 0x09;
const SHIFT_TAB_KEY: u16 = 0x19;
@ -260,7 +261,7 @@ unsafe fn get_key_text(
"space"
}
BACKSPACE_KEY => "backspace",
ENTER_KEY => "enter",
ENTER_KEY | NUMPAD_ENTER_KEY => "enter",
ESCAPE_KEY => "escape",
TAB_KEY => "tab",
SHIFT_TAB_KEY => "tab",