diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-10-25 17:13:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-10-25 17:13:02 +0400 |
commit | f149e49dffaa9e932d71522fcb73c50d9613d787 (patch) | |
tree | 9157f40fdcba2fcbcecebc735fbde14cb9995546 | |
parent | 3d903ee3ffcc5628adfe3dba44bdb314d6646022 (diff) |
- fix numpad comma replacement which was broken since unicode input was added.
- add blender-softwaregl wrapper script for unix
- quiet compiler warning.
-rw-r--r--[-rwxr-xr-x] | release/bin/blender-softwaregl | 0 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 20 |
2 files changed, 14 insertions, 6 deletions
diff --git a/release/bin/blender-softwaregl b/release/bin/blender-softwaregl index 3cd96d2ff34..3cd96d2ff34 100755..100644 --- a/release/bin/blender-softwaregl +++ b/release/bin/blender-softwaregl diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 9d8e2f33f5c..e49cb4898d9 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1944,18 +1944,26 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle if((event->ascii || event->utf8_buf[0]) && (retval == WM_UI_HANDLER_CONTINUE)) { char ascii = event->ascii; + const char *utf8_buf= event->utf8_buf; /* exception that's useful for number buttons, some keyboard numpads have a comma instead of a period */ - if(ELEM3(but->type, NUM, NUMABS, NUMSLI)) - if(event->type == PADPERIOD && ascii == ',') + if(ELEM3(but->type, NUM, NUMABS, NUMSLI)) { /* could use data->min*/ + if(event->type == PADPERIOD && ascii == ',') { ascii = '.'; + utf8_buf= NULL; /* force ascii fallback */ + } + } - if(event->utf8_buf[0]) { + if(utf8_buf && utf8_buf[0]) { + int utf8_buf_len= BLI_str_utf8_size(utf8_buf); /* keep this printf until utf8 is well tested */ - printf("%s: utf8 char '%.*s'\n", __func__, BLI_str_utf8_size(event->utf8_buf), event->utf8_buf); - // strcpy(event->utf8_buf, "12345"); - changed= ui_textedit_type_buf(but, data, event->utf8_buf, BLI_str_utf8_size(event->utf8_buf)); + if (utf8_buf_len != 1) { + printf("%s: utf8 char '%.*s'\n", __func__, utf8_buf_len, utf8_buf); + } + + // strcpy(utf8_buf, "12345"); + changed= ui_textedit_type_buf(but, data, event->utf8_buf, utf8_buf_len); } else { changed= ui_textedit_type_ascii(but, data, ascii); |