diff options
author | Mats Lidell <matsl@rockbox.org> | 2003-01-26 00:33:06 +0000 |
---|---|---|
committer | Mats Lidell <matsl@rockbox.org> | 2003-01-26 00:33:06 +0000 |
commit | 50a1dcb9dde78569a3ec8380932c9130e605f064 (patch) | |
tree | f3eaf244de24ea3e893e5332196ea2e9b970e229 | |
parent | 95c542f8dfe512411a021ae1993e36ec257d2642 (diff) | |
download | rockbox-50a1dcb9dde78569a3ec8380932c9130e605f064.tar.gz rockbox-50a1dcb9dde78569a3ec8380932c9130e605f064.zip |
Cursor movement in the middle of the screen only moves the cursor.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3162 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/player/keyboard.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/apps/player/keyboard.c b/apps/player/keyboard.c index 15349a65fd..b33dcebbdf 100644 --- a/apps/player/keyboard.c +++ b/apps/player/keyboard.c | |||
@@ -92,6 +92,8 @@ int kbd_input(char* text, int buflen) | |||
92 | int button_pressed; | 92 | int button_pressed; |
93 | unsigned char temptext[12]; | 93 | unsigned char temptext[12]; |
94 | bool cursor_on=true; /* Blinking cursor control */ | 94 | bool cursor_on=true; /* Blinking cursor control */ |
95 | int old_cursor_pos=0; /* Windowed cursor movement */ | ||
96 | int left_pos=0; | ||
95 | 97 | ||
96 | lcd_clear_display(); | 98 | lcd_clear_display(); |
97 | 99 | ||
@@ -99,13 +101,14 @@ int kbd_input(char* text, int buflen) | |||
99 | int i, p; | 101 | int i, p; |
100 | int len = strlen(text); | 102 | int len = strlen(text); |
101 | 103 | ||
102 | /* draw filename */ | 104 | /* draw input */ |
105 | if (old_cursor_pos<cursor_pos && 7<(cursor_pos-left_pos) && cursor_pos<(len-1)) | ||
106 | left_pos++; | ||
107 | else | ||
108 | if (cursor_pos<old_cursor_pos && (cursor_pos-left_pos)<2 && 0<left_pos) | ||
109 | left_pos--; | ||
103 | p=0; | 110 | p=0; |
104 | i=0; | 111 | i = left_pos; |
105 | if (cursor_pos>7) { | ||
106 | i=cursor_pos-7; | ||
107 | } | ||
108 | |||
109 | while (p<10 && line[i]) { | 112 | while (p<10 && line[i]) { |
110 | if (i == cursor_pos && cursor_on) | 113 | if (i == cursor_pos && cursor_on) |
111 | { | 114 | { |
@@ -118,6 +121,7 @@ int kbd_input(char* text, int buflen) | |||
118 | temptext[p]=0; | 121 | temptext[p]=0; |
119 | lcd_puts(1, 0, temptext); | 122 | lcd_puts(1, 0, temptext); |
120 | cursor_on = !cursor_on; | 123 | cursor_on = !cursor_on; |
124 | old_cursor_pos=cursor_pos; | ||
121 | 125 | ||
122 | switch (menu_line) { | 126 | switch (menu_line) { |
123 | case MENU_LINE_INPUT: | 127 | case MENU_LINE_INPUT: |