summaryrefslogtreecommitdiff
path: root/firmware/export/button.h
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 /firmware/export/button.h
parent17f54a40f100a3343a15a431d235699024aa76c8 (diff)
downloadrockbox-6c33c51a4ca9907d23e3154d956fd6781122f492.tar.gz
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 'firmware/export/button.h')
-rw-r--r--firmware/export/button.h33
1 files changed, 17 insertions, 16 deletions
diff --git a/firmware/export/button.h b/firmware/export/button.h
index 7f4998f48d..7ec484440f 100644
--- a/firmware/export/button.h
+++ b/firmware/export/button.h
@@ -37,7 +37,7 @@ void button_set_flip(bool flip); /* turn 180 degrees */
37#define BUTTON_NONE 0x0000 37#define BUTTON_NONE 0x0000
38 38
39#ifdef HAVE_NEO_KEYPAD 39#ifdef HAVE_NEO_KEYPAD
40 40/* neo button codes */
41#define BUTTON_UP 0x0080 41#define BUTTON_UP 0x0080
42#define BUTTON_DOWN 0x0010 42#define BUTTON_DOWN 0x0010
43#define BUTTON_LEFT 0x0001 43#define BUTTON_LEFT 0x0001
@@ -80,9 +80,6 @@ void button_set_flip(bool flip); /* turn 180 degrees */
80#else 80#else
81 81
82/* Shared button codes */ 82/* Shared button codes */
83#define BUTTON_ON 0x0001
84#define BUTTON_UP 0x0010
85#define BUTTON_DOWN 0x0020
86#define BUTTON_LEFT 0x0040 83#define BUTTON_LEFT 0x0040
87#define BUTTON_RIGHT 0x0080 84#define BUTTON_RIGHT 0x0080
88 85
@@ -94,38 +91,42 @@ void button_set_flip(bool flip); /* turn 180 degrees */
94/* remote control buttons */ 91/* remote control buttons */
95#define BUTTON_RC_VOL_UP (0x0008 | BUTTON_REMOTE) 92#define BUTTON_RC_VOL_UP (0x0008 | BUTTON_REMOTE)
96#define BUTTON_RC_VOL_DOWN (0x0800 | BUTTON_REMOTE) 93#define BUTTON_RC_VOL_DOWN (0x0800 | BUTTON_REMOTE)
97#define BUTTON_RC_PLAY (BUTTON_UP | BUTTON_REMOTE)
98#define BUTTON_RC_STOP (BUTTON_DOWN | BUTTON_REMOTE)
99#define BUTTON_RC_LEFT (BUTTON_LEFT | BUTTON_REMOTE) 94#define BUTTON_RC_LEFT (BUTTON_LEFT | BUTTON_REMOTE)
100#define BUTTON_RC_RIGHT (BUTTON_RIGHT| BUTTON_REMOTE) 95#define BUTTON_RC_RIGHT (BUTTON_RIGHT| BUTTON_REMOTE)
101 96
102#ifdef HAVE_RECORDER_KEYPAD 97#ifdef HAVE_RECORDER_KEYPAD
103 98
104/* Recorder specific button codes */ 99/* Recorder specific button codes */
100#define BUTTON_ON 0x0001
105#define BUTTON_OFF 0x0002 101#define BUTTON_OFF 0x0002
106#define BUTTON_PLAY 0x0004 102#define BUTTON_PLAY 0x0004
103#define BUTTON_UP 0x0010
104#define BUTTON_DOWN 0x0020
107#define BUTTON_F1 0x0100 105#define BUTTON_F1 0x0100
108#define BUTTON_F2 0x0200 106#define BUTTON_F2 0x0200
109#define BUTTON_F3 0x0400 107#define BUTTON_F3 0x0400
110 108
109#define BUTTON_RC_PLAY (BUTTON_PLAY | BUTTON_REMOTE)
110#define BUTTON_RC_STOP (BUTTON_OFF | BUTTON_REMOTE)
111
111#elif defined(HAVE_PLAYER_KEYPAD) 112#elif defined(HAVE_PLAYER_KEYPAD)
112 113
113/* Jukebox 6000 and Studio specific button codes */ 114/* Jukebox 6000 and Studio specific button codes */
115#define BUTTON_ON 0x0001
114#define BUTTON_MENU 0x0002 116#define BUTTON_MENU 0x0002
115#define BUTTON_PLAY BUTTON_UP 117#define BUTTON_PLAY 0x0010
116#define BUTTON_STOP BUTTON_DOWN 118#define BUTTON_STOP 0x0020
119
120#define BUTTON_RC_PLAY (BUTTON_PLAY | BUTTON_REMOTE)
121#define BUTTON_RC_STOP (BUTTON_STOP | BUTTON_REMOTE)
117 122
118#elif defined HAVE_ONDIO_KEYPAD 123#elif defined HAVE_ONDIO_KEYPAD
119 124
120/* Ondio specific button codes */ 125/* Ondio specific button codes */
121#define BUTTON_MENU 0x0002 126#define BUTTON_OFF 0x0002
122#define BUTTON_PLAY BUTTON_UP 127#define BUTTON_UP 0x0010
123#define BUTTON_STOP BUTTON_DOWN 128#define BUTTON_DOWN 0x0020
124/* ON is also interpreted as OFF, let's see if that helps a bit */ 129#define BUTTON_MENU 0x0100
125#define BUTTON_OFF BUTTON_ON
126#define BUTTON_F1 0x0100 /* unreacheable */
127#define BUTTON_F2 0x0200 /* unreacheable */
128#define BUTTON_F3 0x0400 /* unreacheable */
129 130
130#endif /* HAVE_RECORDER/PLAYER/ONDIO_KEYPAD */ 131#endif /* HAVE_RECORDER/PLAYER/ONDIO_KEYPAD */
131 132