Only unmark on backspace key

This commit is contained in:
Kovid Goyal 2021-11-11 22:05:39 +05:30
parent ca9fdadf3c
commit 8644fed534
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1225,6 +1225,7 @@ is_ascii_control_char(char x) {
const uint32_t key = translateKey(keycode, true); const uint32_t key = translateKey(keycode, true);
const bool process_text = !window->ns.textInputFilterCallback || window->ns.textInputFilterCallback(key, mods, keycode, flags) != 1; const bool process_text = !window->ns.textInputFilterCallback || window->ns.textInputFilterCallback(key, mods, keycode, flags) != 1;
_glfw.ns.text[0] = 0; _glfw.ns.text[0] = 0;
if (keycode == 0x33 /* backspace */) [self unmarkText];
GLFWkeyevent glfw_keyevent = {.key = key, .native_key = keycode, .action = GLFW_PRESS, .mods = mods}; GLFWkeyevent glfw_keyevent = {.key = key, .native_key = keycode, .action = GLFW_PRESS, .mods = mods};
if (!_glfw.ns.unicodeData) { if (!_glfw.ns.unicodeData) {
// Using the cocoa API for key handling is disabled, as there is no // Using the cocoa API for key handling is disabled, as there is no