diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-10-20 09:30:26 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-10-20 09:30:26 +0400 |
commit | 9bbec84e7e14f11f86baeaea6a9a2bce6b7499de (patch) | |
tree | 0aade91288c4ccdc4cd4e1e0749b5b07474b1a17 /intern/ghost/intern/GHOST_EventKey.h | |
parent | 8e58fceab1452fc914e0fe88aaf7ecc80ea9bdb6 (diff) |
initial support for unicode keyboard input for ghost & blenders WM.
- currently X11 only, depends on Xinput (but should not break other os's).
- ghost stores utf8 buffer, copies to wmEvent's
- UI text input is currently the only area that uses this - not console or text editor.
- no rna access yet.
Diffstat (limited to 'intern/ghost/intern/GHOST_EventKey.h')
-rw-r--r-- | intern/ghost/intern/GHOST_EventKey.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/intern/ghost/intern/GHOST_EventKey.h b/intern/ghost/intern/GHOST_EventKey.h index 3581cd86b20..a8fca1e8f2d 100644 --- a/intern/ghost/intern/GHOST_EventKey.h +++ b/intern/ghost/intern/GHOST_EventKey.h @@ -55,6 +55,7 @@ public: { m_keyEventData.key = key; m_keyEventData.ascii = '\0'; + m_keyEventData.utf8_buf[0]= '\0'; m_data = &m_keyEventData; } @@ -65,11 +66,13 @@ public: * @param key The key code of the key. * @param ascii The ascii code for the key event. */ - GHOST_EventKey(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow* window, GHOST_TKey key, char ascii) + GHOST_EventKey(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow* window, GHOST_TKey key, char ascii, const char utf8_buf[6]) : GHOST_Event(msec, type, window) { m_keyEventData.key = key; m_keyEventData.ascii = ascii; + if (utf8_buf) memcpy(m_keyEventData.utf8_buf, utf8_buf, sizeof(m_keyEventData.utf8_buf)); + else m_keyEventData.utf8_buf[0]= '\0'; m_data = &m_keyEventData; } |