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 /source/blender/windowmanager | |
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 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_types.h | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index fec59e97194..f28fb08ac6e 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -341,8 +341,8 @@ typedef struct wmEvent { short val; /* press, release, scrollvalue */ int x, y; /* mouse pointer position, screen coord */ int mval[2]; /* region mouse position, name convention pre 2.5 :) */ - short unicode; /* future, ghost? */ - char ascii; /* from ghost */ + char utf8_buf[6]; /* from, ghost if utf8 is enabled for the platform */ + char ascii; /* from ghost, fallback if utf8 isnt set */ char pad; /* previous state */ diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 33e98007fed..7dcb4cf091f 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2578,6 +2578,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U GHOST_TEventKeyData *kd= customdata; event.type= convert_key(kd->key); event.ascii= kd->ascii; + strcpy(event.utf8_buf, kd->utf8_buf); event.val= (type==GHOST_kEventKeyDown)?KM_PRESS:KM_RELEASE; /* exclude arrow keys, esc, etc from text input */ |