summaryrefslogtreecommitdiff
path: root/src/gui/textbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/textbox.cpp')
-rw-r--r--src/gui/textbox.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/textbox.cpp b/src/gui/textbox.cpp
index 688450b..c367193 100644
--- a/src/gui/textbox.cpp
+++ b/src/gui/textbox.cpp
@@ -178,18 +178,20 @@ void gui_textbox_handle_repeat( GUI_TEXTBOX* tb ) {
if( gui_time() - tb->repeattime > 0.05f ) {
U32 len = strlen( tb->value );
if( is_printable_char( tb->heldkey ) && len < (tb->maxlen - 1) ) {
+ if( tb->pre_cb ) tb->pre_cb( tb );
+
if( tb->keys[SDLK_LSHIFT & 0xff] || tb->keys[SDLK_RSHIFT & 0xff] )
tb->value[len] = tb->heldkey + ('a' - 'A');
else
tb->value[len] = tb->heldkey;
tb->value[++len] = 0;
- if( tb->cb )
- tb->cb( tb );
+
+ if( tb->cb ) tb->cb( tb );
}
else if( tb->heldkey == '\b' && len > 0 ) {
+ if( tb->pre_cb ) tb->pre_cb( tb );
tb->value[--len] = 0;
- if( tb->cb )
- tb->cb( tb );
+ if( tb->cb ) tb->cb( tb );
}
tb->repeattime = gui_time();