From 6c33c51a4ca9907d23e3154d956fd6781122f492 Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Sun, 19 Sep 2004 21:58:37 +0000 Subject: 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 --- apps/player/keyboard.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'apps/player/keyboard.c') 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_pos0) 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; -- cgit v1.2.3