From 9a6092dd1bd6faabf81719ea871c9765458a0189 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Mon, 4 Jul 2022 10:01:56 +0200 Subject: [PATCH] Support hitting enter on numpad --- crates/gpui/src/platform/mac/event.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/gpui/src/platform/mac/event.rs b/crates/gpui/src/platform/mac/event.rs index ed4303cc4d..ed880513e8 100644 --- a/crates/gpui/src/platform/mac/event.rs +++ b/crates/gpui/src/platform/mac/event.rs @@ -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",