mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-02 20:18:22 +08:00
improve edit
This commit is contained in:
parent
93e6509246
commit
d6472492eb
@ -35,6 +35,11 @@
|
||||
#define STB_TEXTEDIT_NEWLINE (wchar_t)('\n')
|
||||
#define STB_TEXTEDIT_STRING text_edit_t
|
||||
|
||||
#if !defined(WITH_SDL)
|
||||
#define STB_TEXTEDIT_UNDOSTATECOUNT 10
|
||||
#define STB_TEXTEDIT_UNDOCHARCOUNT 32
|
||||
#endif /*WITH_SDL*/
|
||||
|
||||
#include "stb/stb_textedit.h"
|
||||
|
||||
typedef struct _text_layout_info_t {
|
||||
|
@ -424,7 +424,10 @@ static ret_t edit_on_key_down(widget_t* widget, key_event_t* e) {
|
||||
} else {
|
||||
text_edit_key_down(edit->model, (key_event_t*)e);
|
||||
}
|
||||
edit_dispatch_event(widget, EVT_VALUE_CHANGING);
|
||||
|
||||
if (key != TK_KEY_LEFT && key != TK_KEY_RIGHT && key != TK_KEY_HOME && key != TK_KEY_END) {
|
||||
edit_dispatch_event(widget, EVT_VALUE_CHANGING);
|
||||
}
|
||||
} else if (system_info()->app_type != APP_DESKTOP && key < 128 && isprint(key)) {
|
||||
edit_input_char(widget, (wchar_t)key);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user