summaryrefslogtreecommitdiffstats
path: root/apps/player
diff options
context:
space:
mode:
authorMats Lidell <matsl@rockbox.org>2003-01-26 00:33:06 +0000
committerMats Lidell <matsl@rockbox.org>2003-01-26 00:33:06 +0000
commit50a1dcb9dde78569a3ec8380932c9130e605f064 (patch)
treef3eaf244de24ea3e893e5332196ea2e9b970e229 /apps/player
parent95c542f8dfe512411a021ae1993e36ec257d2642 (diff)
downloadrockbox-50a1dcb9dde78569a3ec8380932c9130e605f064.tar.gz
rockbox-50a1dcb9dde78569a3ec8380932c9130e605f064.tar.bz2
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
Diffstat (limited to 'apps/player')
-rw-r--r--apps/player/keyboard.c16
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)
int button_pressed;
unsigned char temptext[12];
bool cursor_on=true; /* Blinking cursor control */
+ int old_cursor_pos=0; /* Windowed cursor movement */
+ int left_pos=0;
lcd_clear_display();
@@ -99,13 +101,14 @@ int kbd_input(char* text, int buflen)
int i, p;
int len = strlen(text);
- /* draw filename */
+ /* draw input */
+ if (old_cursor_pos<cursor_pos && 7<(cursor_pos-left_pos) && cursor_pos<(len-1))
+ left_pos++;
+ else
+ if (cursor_pos<old_cursor_pos && (cursor_pos-left_pos)<2 && 0<left_pos)
+ left_pos--;
p=0;
- i=0;
- if (cursor_pos>7) {
- i=cursor_pos-7;
- }
-
+ i = left_pos;
while (p<10 && line[i]) {
if (i == cursor_pos && cursor_on)
{
@@ -118,6 +121,7 @@ int kbd_input(char* text, int buflen)
temptext[p]=0;
lcd_puts(1, 0, temptext);
cursor_on = !cursor_on;
+ old_cursor_pos=cursor_pos;
switch (menu_line) {
case MENU_LINE_INPUT: