From 79e040ba9581a2f386bbb467d43998e779accf78 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 10 Jan 2014 19:39:35 +0100 Subject: [PATCH] Fix T38143: pressing F12 key in the text editor on OS X would type an invalid character. --- intern/ghost/intern/GHOST_SystemCocoa.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index c60ded15d6c..b7b1079844e 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -1559,6 +1559,10 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr) if ((keyCode > 266) && (keyCode < 271)) utf8_buf[0] = '\0'; + /* F keys should not have utf8 */ + if ((keyCode >= GHOST_kKeyF1) && (keyCode <= GHOST_kKeyF20)) + utf8_buf[0] = '\0'; + /* no text with command key pressed */ if (m_modifierMask & NSCommandKeyMask) utf8_buf[0] = '\0';