Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-10-21 13:15:22 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-10-21 13:15:22 +0400
commited3be3b950ff8328203fa11623062859f2be85c0 (patch)
tree7cb4b04a2622506cfeaa58f1a0e6a9fa2c33cc8b /intern
parent526106d2751c3527a99cf9436d72c6c02a8f0d12 (diff)
parenta35261cfee1e04bca3366e6967e046cdb00d3d44 (diff)
Merging r41158 through r41175 from trunk into soc-2011-tomato
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/GHOST_Types.h11
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.mm4
2 files changed, 15 insertions, 0 deletions
diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index 78fc3f69c7a..2b5e96a1bf7 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -466,8 +466,19 @@ typedef struct {
typedef struct {
/** The key code. */
GHOST_TKey key;
+
+ /* ascii / utf8: both should always be set when possible,
+ * - ascii may be '\0' however if the user presses a non ascii key
+ * - unicode may not be set if the system has no unicode support
+ *
+ * These values are intended to be used as follows.
+ * For text input use unicode when available, fallback to ascii.
+ * For areas where unicode is not needed, number input for example, always
+ * use ascii, unicode is ignored - campbell.
+ */
/** The ascii code for the key event ('\0' if none). */
char ascii;
+ /** The unicode character. if the length is 6, not NULL terminated if all 6 are set */
char utf8_buf[6];
} GHOST_TEventKeyData;
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 1dfb8e36422..c3c0c591444 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -1706,6 +1706,10 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
utf8_buf[0] = '\0';
}
}
+
+ /* XXX the above code gives us the right utf8, however if we pass it along Font Object doesn't work.
+ let's leave utf8 disabled for OSX before we fix that */
+ utf8_buf[0] = '\0';//to be removed once things are working
if ((keyCode == GHOST_kKeyQ) && (m_modifierMask & NSCommandKeyMask))
break; //Cmd-Q is directly handled by Cocoa