summaryrefslogtreecommitdiffstats
path: root/uisimulator/x11/button-x11.c
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 /uisimulator/x11/button-x11.c
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 'uisimulator/x11/button-x11.c')
-rw-r--r--uisimulator/x11/button-x11.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/uisimulator/x11/button-x11.c b/uisimulator/x11/button-x11.c
index 951bf730c5..534568b658 100644
--- a/uisimulator/x11/button-x11.c
+++ b/uisimulator/x11/button-x11.c
@@ -75,35 +75,49 @@ static int get_raw_button (void)
case XK_KP_Up:
case XK_Up:
case XK_KP_8:
+#ifdef BUTTON_UP
k = BUTTON_UP;
+#elif defined BUTTON_PLAY
+ k = BUTTON_PLAY;
+#endif
break;
case XK_KP_Down:
case XK_Down:
case XK_KP_2:
+#ifdef BUTTON_DOWN
k = BUTTON_DOWN;
+#elif defined BUTTON_STOP
+ k = BUTTON_STOP;
+#endif
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#ifdef BUTTON_PLAY
case XK_KP_Space:
case XK_KP_5:
case XK_KP_Begin:
case XK_space:
k = BUTTON_PLAY;
break;
+#endif
+#ifdef BUTTON_OFF
case XK_KP_Enter:
case XK_A:
case XK_a:
k = BUTTON_OFF;
break;
+#endif
+#ifdef BUTTON_ON
case XK_KP_Add:
case XK_Q:
case XK_q:
k = BUTTON_ON;
break;
+#endif
+#ifdef BUTTON_F1
case XK_KP_Divide:
case XK_1:
k = BUTTON_F1;
@@ -118,7 +132,9 @@ static int get_raw_button (void)
case XK_3:
k = BUTTON_F3;
break;
+#endif
+#ifdef HAVE_LCD_BITMAP
case XK_5:
if(!release)
{
@@ -126,16 +142,16 @@ static int get_raw_button (void)
return 0;
}
break;
+#endif
-#else
- case XK_KP_Add:
- case XK_Q:
- case XK_q:
- k = BUTTON_ON;
- break;
-
+#ifdef BUTTON_MENU
+#ifdef HAVE_PLAYER_KEYPAD
case XK_KP_Enter:
case XK_Return:
+#elif defined HAVE_ONDIO_KEYPAD
+ case XK_KP_Insert:
+ case XK_Control_R:
+#endif
k = BUTTON_MENU;
break;
#endif