1
0
Fork 0
forked from len0rd/rockbox

Fixed busy loop, and implemented a simpler kind of cursor blinking that also ensures blinking always starts with 'cursor visible' after button actions. Removed redraw variable, since we now always redraw.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9757 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2006-04-22 13:06:57 +00:00
parent a1db431d50
commit b5991b27ca

View file

@ -338,10 +338,9 @@ int kbd_input(char* text, int buflen)
int statusbar_size = global_settings.statusbar ? STATUSBAR_HEIGHT : 0; int statusbar_size = global_settings.statusbar ? STATUSBAR_HEIGHT : 0;
unsigned short ch, tmp, hlead = 0, hvowel = 0, htail = 0; unsigned short ch, tmp, hlead = 0, hvowel = 0, htail = 0;
bool hangul = false; bool hangul = false;
bool redraw = true;
unsigned char *utf8; unsigned char *utf8;
const unsigned char *p; const unsigned char *p;
int cur_blink = current_tick; bool cur_blink = true;
#ifdef KBD_MORSE_INPUT #ifdef KBD_MORSE_INPUT
bool morse_reading = false; bool morse_reading = false;
unsigned char morse_code = 0; unsigned char morse_code = 0;
@ -448,8 +447,6 @@ int kbd_input(char* text, int buflen)
{ {
len_utf8 = utf8length(text); len_utf8 = utf8length(text);
if(redraw)
{
lcd_clear_display(); lcd_clear_display();
#ifdef KBD_MORSE_INPUT #ifdef KBD_MORSE_INPUT
@ -534,14 +531,15 @@ int kbd_input(char* text, int buflen)
/* cursor */ /* cursor */
i = (curpos + 1) * text_w; i = (curpos + 1) * text_w;
if(cur_blink%125 > 50) if (cur_blink)
lcd_vline(i, main_y, main_y + font_h-1); lcd_vline(i, main_y, main_y + font_h-1);
cur_blink = !cur_blink;
if (hangul) /* draw underbar */ if (hangul) /* draw underbar */
lcd_hline(curpos*text_w, (curpos+1)*text_w, main_y+font_h-1); lcd_hline(curpos*text_w, (curpos+1)*text_w, main_y+font_h-1);
cur_blink = current_tick;
#ifdef HAS_BUTTONBAR #ifdef HAS_BUTTONBAR
/* draw the status bar */ /* draw the button bar */
gui_buttonbar_set(&buttonbar, "Shift", "OK", "Del"); gui_buttonbar_set(&buttonbar, "Shift", "OK", "Del");
gui_buttonbar_draw(&buttonbar); gui_buttonbar_draw(&buttonbar);
#endif #endif
@ -566,12 +564,8 @@ int kbd_input(char* text, int buflen)
gui_syncstatusbar_draw(&statusbars, true); gui_syncstatusbar_draw(&statusbars, true);
lcd_update(); lcd_update();
}
/* The default action is to redraw */ button = button_get_w_tmo(HZ/2);
redraw = true;
button = button_get(false);
#ifdef KBD_MORSE_INPUT #ifdef KBD_MORSE_INPUT
if (morse_mode) if (morse_mode)
{ {
@ -940,7 +934,6 @@ int kbd_input(char* text, int buflen)
if (global_settings.talk_menu) /* voice UI? */ if (global_settings.talk_menu) /* voice UI? */
talk_spell(text, false); /* speak revised text */ talk_spell(text, false); /* speak revised text */
redraw = true;
} }
#endif #endif
@ -953,7 +946,10 @@ int kbd_input(char* text, int buflen)
} }
if (button != BUTTON_NONE) if (button != BUTTON_NONE)
{
lastbutton = button; lastbutton = button;
cur_blink = true;
}
} }
#ifdef HAS_BUTTONBAR #ifdef HAS_BUTTONBAR
global_settings.buttonbar=buttonbar_config; global_settings.buttonbar=buttonbar_config;