From af0ea50e7e4cdc1314a058dd2330866969c0e134 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Sun, 20 Jan 2013 16:05:49 -0500 Subject: Scroll the selected file name faster in file selection dialogs. --- source/nds/gui.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index 969925f..915f411 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -808,6 +808,14 @@ s32 load_file(char **wildcards, char *result, char *default_dir_name) gui_action = get_gui_input(); int mod; + // Get KEY_RIGHT and KEY_LEFT separately to allow scrolling + // the selected file name faster. + ds2_getrawInput(&inputdata); + if (inputdata.key & KEY_RIGHT) + redraw = -3; + else if (inputdata.key & KEY_LEFT) + redraw = 3; + switch(gui_action) { case CURSOR_TOUCH: @@ -969,13 +977,11 @@ s32 load_file(char **wildcards, char *result, char *default_dir_name) break; } - //scroll string + //scroll string (see above the switch) case CURSOR_RIGHT: - redraw = -5; - break; - //scroll string + /* fall through */ + //scroll string (see above the switch) case CURSOR_LEFT: - redraw = 5; break; case CURSOR_SELECT: @@ -1128,7 +1134,6 @@ s32 load_file(char **wildcards, char *result, char *default_dir_name) } redraw = 0; - ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); } //end if(0 != redraw) else if(0 != redraw) { unsigned int m, n; @@ -1156,7 +1161,6 @@ s32 load_file(char **wildcards, char *result, char *default_dir_name) } draw_hscroll(m+1, redraw); - ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); redraw = 0; } @@ -1176,10 +1180,11 @@ s32 load_file(char **wildcards, char *result, char *default_dir_name) { if(draw_hscroll(0, 1) <= 1) path_scroll = 0x8000; //scroll left } - ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); } - mdelay(50); //about 50ms + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); + + mdelay(20); //about 50ms } //end while(repeat) unsigned int i; -- cgit v1.2.3