Fix #27850: keyboards with a comma instead of a dot on the numpad now get

converted to a dot when typing into number buttons, for easier number entry.
This commit is contained in:
Brecht Van Lommel 2011-07-04 10:56:59 +00:00
parent cf43e48fc7
commit ca2c319649

@ -1895,7 +1895,15 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
}
if(event->ascii && (retval == WM_UI_HANDLER_CONTINUE)) {
changed= ui_textedit_type_ascii(but, data, event->ascii);
char ascii = event->ascii;
/* 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 == ',')
ascii = '.';
changed= ui_textedit_type_ascii(but, data, ascii);
retval= WM_UI_HANDLER_BREAK;
}