From 8644fed534c7b10af8b07bc93ba118f7a90829a4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 11 Nov 2021 22:05:39 +0530 Subject: [PATCH] Only unmark on backspace key --- glfw/cocoa_window.m | 1 + 1 file changed, 1 insertion(+) diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index 384daff9e..bd634dd69 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -1225,6 +1225,7 @@ is_ascii_control_char(char x) { const uint32_t key = translateKey(keycode, true); const bool process_text = !window->ns.textInputFilterCallback || window->ns.textInputFilterCallback(key, mods, keycode, flags) != 1; _glfw.ns.text[0] = 0; + if (keycode == 0x33 /* backspace */) [self unmarkText]; GLFWkeyevent glfw_keyevent = {.key = key, .native_key = keycode, .action = GLFW_PRESS, .mods = mods}; if (!_glfw.ns.unicodeData) { // Using the cocoa API for key handling is disabled, as there is no