summaryrefslogtreecommitdiffstats
path: root/apps/player
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2004-09-19 21:58:37 +0000
committerBjörn Stenberg <bjorn@haxx.se>2004-09-19 21:58:37 +0000
commit6c33c51a4ca9907d23e3154d956fd6781122f492 (patch)
treef0e598efaf064bb72c33c0a8a2edba4cf9ebb13c /apps/player
parent17f54a40f100a3343a15a431d235699024aa76c8 (diff)
downloadrockbox-6c33c51a4ca9907d23e3154d956fd6781122f492.tar.gz
rockbox-6c33c51a4ca9907d23e3154d956fd6781122f492.tar.bz2
rockbox-6c33c51a4ca9907d23e3154d956fd6781122f492.zip
Redesigned the button handling. The code now uses symbolic function defines instead of checking for specific buttons. This makes it easier to add support for new devices with different button layouts.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5091 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/player')
-rw-r--r--apps/player/keyboard.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/apps/player/keyboard.c b/apps/player/keyboard.c
index 495102b29a..7752ce3ff7 100644
--- a/apps/player/keyboard.c
+++ b/apps/player/keyboard.c
@@ -181,14 +181,15 @@ int kbd_input(char* text, int buflen)
case MENU_LINE_INPUT:
switch (button_pressed)
{
- case BUTTON_UP:
- case BUTTON_UP | BUTTON_REPEAT:
+ case BUTTON_PLAY:
+ case BUTTON_PLAY | BUTTON_REPEAT:
if (cursor_pos<len)
cursor_pos++;
button_pressed=BUTTON_NONE;
break;
- case BUTTON_DOWN:
- case BUTTON_DOWN | BUTTON_REPEAT:
+
+ case BUTTON_STOP:
+ case BUTTON_STOP | BUTTON_REPEAT:
if (cursor_pos>0)
cursor_pos--;
button_pressed=BUTTON_NONE;
@@ -199,13 +200,13 @@ int kbd_input(char* text, int buflen)
case MENU_LINE_NEWCHARS:
switch (button_pressed)
{
- case BUTTON_UP:
- case BUTTON_UP | BUTTON_REPEAT:
+ case BUTTON_PLAY:
+ case BUTTON_PLAY | BUTTON_REPEAT:
x=(x+1+linelen)%linelen;
button_pressed=BUTTON_NONE;
break;
- case BUTTON_DOWN:
- case BUTTON_DOWN | BUTTON_REPEAT:
+ case BUTTON_STOP:
+ case BUTTON_STOP | BUTTON_REPEAT:
x=(x-1+linelen)%linelen;
button_pressed=BUTTON_NONE;
break;