summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)
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: