summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-05-22 06:31:44 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-05-22 06:31:44 +0000
commit8970055ec107a2387eedbb373889d0f540745121 (patch)
tree369d5eebe74858a6d767c1d039d8213097caa884
parent1e8f0e7c6428cc8f11005b077e8c9e1551ca5f69 (diff)
downloadrockbox-8970055ec107a2387eedbb373889d0f540745121.tar.gz
rockbox-8970055ec107a2387eedbb373889d0f540745121.tar.bz2
rockbox-8970055ec107a2387eedbb373889d0f540745121.zip
Hopefully take care of the scrollwheel difficulties in plugins on e200.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13460 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/bounce.c4
-rw-r--r--apps/plugins/brickmania.c15
-rw-r--r--apps/plugins/demystify.c18
-rw-r--r--apps/plugins/doom/i_video.c32
-rw-r--r--apps/plugins/jpeg.c28
-rw-r--r--apps/plugins/oscilloscope.c4
-rw-r--r--apps/plugins/rockboy/sys_rockbox.c35
-rw-r--r--apps/plugins/spacerocks.c8
-rw-r--r--apps/plugins/vu_meter.c6
9 files changed, 118 insertions, 32 deletions
diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c
index 1f890fa8a1..2b79e36ddd 100644
--- a/apps/plugins/bounce.c
+++ b/apps/plugins/bounce.c
@@ -457,16 +457,20 @@ static int loopit(void)
if(timeout) {
switch(b) {
case BUTTON_LEFT:
+ case BUTTON_LEFT|BUTTON_REPEAT:
values[show].num--;
break;
case BUTTON_RIGHT:
+ case BUTTON_RIGHT|BUTTON_REPEAT:
values[show].num++;
break;
case BOUNCE_UP:
+ case BOUNCE_UP|BUTTON_REPEAT:
if(++show == NUM_LAST)
show=0;
break;
case BOUNCE_DOWN:
+ case BOUNCE_DOWN|BUTTON_REPEAT:
if(--show < 0)
show=NUM_LAST-1;
break;
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index 2557738984..93b759d48c 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -117,14 +117,15 @@ PLUGIN_HEADER
#elif CONFIG_KEYPAD == SANSA_E200_PAD
-#define QUIT BUTTON_POWER
-#define LEFT BUTTON_LEFT
-#define RIGHT BUTTON_RIGHT
+#define QUIT BUTTON_POWER
+#define LEFT BUTTON_LEFT
+#define RIGHT BUTTON_RIGHT
#define SELECT BUTTON_SELECT
-#define UP BUTTON_SCROLL_UP
-#define DOWN BUTTON_SCROLL_DOWN
-#define SCROLL_FWD(x) (0)
-#define SCROLL_BACK(x) (0)
+#define UP BUTTON_SCROLL_UP
+#define DOWN BUTTON_SCROLL_DOWN
+
+#define SCROLL_FWD(x) ((x) & BUTTON_SCROLL_DOWN)
+#define SCROLL_BACK(x) ((x) & BUTTON_SCROLL_UP)
#elif CONFIG_KEYPAD == IRIVER_H10_PAD /* grayscale at the moment */
diff --git a/apps/plugins/demystify.c b/apps/plugins/demystify.c
index 3fe5966eaa..c5162c6fa2 100644
--- a/apps/plugins/demystify.c
+++ b/apps/plugins/demystify.c
@@ -34,11 +34,13 @@ PLUGIN_HEADER
#define DEMYSTIFY_INCREASE_SPEED BUTTON_SCROLL_FWD
#define DEMYSTIFY_DECREASE_SPEED BUTTON_SCROLL_BACK
#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
-#define DEMYSTIFY_QUIT BUTTON_POWER
-#define DEMYSTIFY_ADD_POLYGON BUTTON_RIGHT
-#define DEMYSTIFY_REMOVE_POLYGON BUTTON_LEFT
-#define DEMYSTIFY_INCREASE_SPEED BUTTON_SCROLL_UP
-#define DEMYSTIFY_DECREASE_SPEED BUTTON_SCROLL_DOWN
+#define DEMYSTIFY_QUIT BUTTON_POWER
+#define DEMYSTIFY_ADD_POLYGON BUTTON_RIGHT
+#define DEMYSTIFY_REMOVE_POLYGON BUTTON_LEFT
+#define DEMYSTIFY_INCREASE_SPEED BUTTON_SCROLL_DOWN
+#define DEMYSTIFY_INCREASE_SPEED_REP (BUTTON_SCROLL_DOWN|BUTTON_REPEAT)
+#define DEMYSTIFY_DECREASE_SPEED BUTTON_SCROLL_UP
+#define DEMYSTIFY_DECREASE_SPEED_REP (BUTTON_SCROLL_UP|BUTTON_REPEAT)
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define DEMYSTIFY_QUIT BUTTON_POWER
#define DEMYSTIFY_ADD_POLYGON BUTTON_RIGHT
@@ -417,6 +419,9 @@ int plugin_main(void)
#ifdef DEMYSTIFY_RC_INCREASE_SPEED
case DEMYSTIFY_RC_INCREASE_SPEED:
#endif
+#ifdef DEMYSTIFY_INCREASE_SPEED_REP
+ case DEMYSTIFY_INCREASE_SPEED_REP:
+#endif
case DEMYSTIFY_INCREASE_SPEED:
if(sleep_time>=0)
--sleep_time;
@@ -425,6 +430,9 @@ int plugin_main(void)
#ifdef DEMYSTIFY_RC_DECREASE_SPEED
case DEMYSTIFY_RC_DECREASE_SPEED:
#endif
+#ifdef DEMYSTIFY_DECREASE_SPEED_REP
+ case DEMYSTIFY_DECREASE_SPEED_REP:
+#endif
case DEMYSTIFY_DECREASE_SPEED:
++sleep_time;
break;
diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c
index c3ac30f272..6bac32b8ea 100644
--- a/apps/plugins/doom/i_video.c
+++ b/apps/plugins/doom/i_video.c
@@ -179,6 +179,9 @@ void I_ShutdownGraphics(void)
#define DOOMBUTTON_ENTER BUTTON_REW
#define DOOMBUTTON_WEAPON BUTTON_FF
#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define DOOMBUTTON_SCROLLWHEEL
+#define DOOMBUTTON_SCROLLWHEEL_CC BUTTON_SCROLL_UP
+#define DOOMBUTTON_SCROLLWHEEL_CW BUTTON_SCROLL_DOWN
#define DOOMBUTTON_UP BUTTON_UP
#define DOOMBUTTON_DOWN BUTTON_DOWN
#define DOOMBUTTON_LEFT BUTTON_LEFT
@@ -186,8 +189,8 @@ void I_ShutdownGraphics(void)
#define DOOMBUTTON_SHOOT BUTTON_SELECT
#define DOOMBUTTON_OPEN BUTTON_REC
#define DOOMBUTTON_ESC BUTTON_POWER
-#define DOOMBUTTON_ENTER BUTTON_SCROLL_UP
-#define DOOMBUTTON_WEAPON BUTTON_SCROLL_DOWN
+#define DOOMBUTTON_ENTER BUTTON_SELECT
+#define DOOMBUTTON_WEAPON DOOMBUTTON_SCROLLWHEEL_CW
#elif CONFIG_KEYPAD == GIGABEAT_PAD
#define DOOMBUTTON_UP BUTTON_UP
#define DOOMBUTTON_DOWN BUTTON_DOWN
@@ -211,6 +214,27 @@ void I_ShutdownGraphics(void)
#define DOOMBUTTON_WEAPON BUTTON_ON
#endif
+#ifdef DOOMBUTTON_SCROLLWHEEL
+/* Scrollwheel events are posted directly and not polled by the button
+ driver - synthesize polling */
+static inline unsigned int read_scroll_wheel(void)
+{
+ unsigned int buttons = BUTTON_NONE;
+ unsigned int btn;
+
+ /* Empty out the button queue and see if any scrollwheel events were
+ posted */
+ do
+ {
+ btn = rb->button_get_w_tmo(0);
+ buttons |= btn;
+ }
+ while (btn != BUTTON_NONE);
+
+ return buttons & (DOOMBUTTON_SCROLLWHEEL_CC | DOOMBUTTON_SCROLLWHEEL_CW);
+}
+#endif
+
inline void getkey()
{
event_t event;
@@ -247,6 +271,10 @@ inline void getkey()
#endif
newbuttonstate = rb->button_status();
+#ifdef DOOMBUTTON_SCROLLWHEEL
+ newbuttonstate |= read_scroll_wheel();
+#endif
+
if(newbuttonstate==oldbuttonstate) /* Don't continue, nothing left to do */
return;
released = ~newbuttonstate & oldbuttonstate;
diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c
index 255b82faae..ff6df6d4e3 100644
--- a/apps/plugins/jpeg.c
+++ b/apps/plugins/jpeg.c
@@ -126,16 +126,18 @@ PLUGIN_HEADER
#define JPEG_PREVIOUS (BUTTON_A | BUTTON_LEFT)
#elif CONFIG_KEYPAD == SANSA_E200_PAD
-#define JPEG_ZOOM_PRE BUTTON_SELECT
-#define JPEG_ZOOM_IN (BUTTON_SELECT | BUTTON_REL)
-#define JPEG_ZOOM_OUT (BUTTON_SELECT | BUTTON_REPEAT)
-#define JPEG_UP BUTTON_UP
-#define JPEG_DOWN BUTTON_DOWN
-#define JPEG_LEFT BUTTON_LEFT
-#define JPEG_RIGHT BUTTON_RIGHT
-#define JPEG_MENU BUTTON_REC
-#define JPEG_NEXT BUTTON_SCROLL_DOWN
-#define JPEG_PREVIOUS BUTTON_SCROLL_UP
+#define JPEG_ZOOM_PRE BUTTON_SELECT
+#define JPEG_ZOOM_IN (BUTTON_SELECT | BUTTON_REL)
+#define JPEG_ZOOM_OUT (BUTTON_SELECT | BUTTON_REPEAT)
+#define JPEG_UP BUTTON_UP
+#define JPEG_DOWN BUTTON_DOWN
+#define JPEG_LEFT BUTTON_LEFT
+#define JPEG_RIGHT BUTTON_RIGHT
+#define JPEG_MENU BUTTON_REC
+#define JPEG_NEXT BUTTON_SCROLL_DOWN
+#define JPEG_NEXT_REPEAT (BUTTON_SCROLL_DOWN|BUTTON_REPEAT)
+#define JPEG_PREVIOUS BUTTON_SCROLL_UP
+#define JPEG_PREVIOUS_REPEAT (BUTTON_SCROLL_UP|BUTTON_REPEAT)
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define JPEG_ZOOM_PRE BUTTON_PLAY
@@ -2715,11 +2717,17 @@ int scroll_bmp(struct t_disp* pdisp)
if (entries > 0)
return change_filename(DIR_NEXT);
break;
+#ifdef JPEG_NEXT_REPEAT
+ case JPEG_NEXT_REPEAT:
+#endif
case JPEG_NEXT:
if (entries > 0)
return change_filename(DIR_NEXT);
break;
+#ifdef JPEG_PREVIOUS_REPEAT
+ case JPEG_PREVIOUS_REPEAT:
+#endif
case JPEG_PREVIOUS:
if (entries > 0)
return change_filename(DIR_PREV);
diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c
index 57067ab3e3..67d258d7e6 100644
--- a/apps/plugins/oscilloscope.c
+++ b/apps/plugins/oscilloscope.c
@@ -104,8 +104,8 @@ PLUGIN_HEADER
#define OSCILLOSCOPE_PAUSE BUTTON_REC
#define OSCILLOSCOPE_SPEED_UP BUTTON_RIGHT
#define OSCILLOSCOPE_SPEED_DOWN BUTTON_LEFT
-#define OSCILLOSCOPE_VOL_UP BUTTON_SCROLL_UP
-#define OSCILLOSCOPE_VOL_DOWN BUTTON_SCROLL_DOWN
+#define OSCILLOSCOPE_VOL_UP BUTTON_SCROLL_DOWN
+#define OSCILLOSCOPE_VOL_DOWN BUTTON_SCROLL_UP
#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
#define OSCILLOSCOPE_QUIT BUTTON_POWER
diff --git a/apps/plugins/rockboy/sys_rockbox.c b/apps/plugins/rockboy/sys_rockbox.c
index 783accd01b..6cbbe523f7 100644
--- a/apps/plugins/rockboy/sys_rockbox.c
+++ b/apps/plugins/rockboy/sys_rockbox.c
@@ -38,6 +38,16 @@
#define ROCKBOY_PAD_UP BUTTON_SCROLL_UP
#define ROCKBOY_PAD_DOWN BUTTON_SCROLL_DOWN
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+
+#define ROCKBOY_SCROLLWHEEL
+#define ROCKBOY_SCROLLWHEEL_CC BUTTON_SCROLL_UP
+#define ROCKBOY_SCROLLWHEEL_CW BUTTON_SCROLL_DOWN
+#define ROCKBOY_PAD_LEFT BUTTON_LEFT
+#define ROCKBOY_PAD_RIGHT BUTTON_RIGHT
+#define ROCKBOY_PAD_UP BUTTON_UP
+#define ROCKBOY_PAD_DOWN BUTTON_DOWN
+
#else
#define ROCKBOY_PAD_LEFT BUTTON_LEFT
@@ -69,10 +79,35 @@ static int wheelmap[8] = {
int released, pressed;
+
+#ifdef ROCKBOY_SCROLLWHEEL
+/* Scrollwheel events are posted directly and not polled by the button
+ driver - synthesize polling */
+static inline unsigned int read_scroll_wheel(void)
+{
+ unsigned int buttons = BUTTON_NONE;
+ unsigned int btn;
+
+ /* Empty out the button queue and see if any scrollwheel events were
+ posted */
+ do
+ {
+ btn = rb->button_get_w_tmo(0);
+ buttons |= btn;
+ }
+ while (btn != BUTTON_NONE);
+
+ return buttons & (ROCKBOY_SCROLLWHEEL_CC | ROCKBOY_SCROLLWHEEL_CW);
+}
+#endif
+
void ev_poll(void)
{
event_t ev;
newbuttonstate = rb->button_status();
+#ifdef ROCKBOY_SCROLLWHEEL
+ newbuttonstate |= read_scroll_wheel();
+#endif
released = ~newbuttonstate & oldbuttonstate;
pressed = newbuttonstate & ~oldbuttonstate;
oldbuttonstate = newbuttonstate;
diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c
index 85445a0dd4..fd8637cd5f 100644
--- a/apps/plugins/spacerocks.c
+++ b/apps/plugins/spacerocks.c
@@ -125,10 +125,10 @@ static struct plugin_api* rb; /* global api struct pointer */
#define AST_THRUST_REP (BUTTON_UP | BUTTON_REPEAT)
#define AST_THRUST BUTTON_UP
#define AST_HYPERSPACE BUTTON_DOWN
-#define AST_LEFT BUTTON_LEFT
-#define AST_LEFT_REP (BUTTON_LEFT | BUTTON_REPEAT)
-#define AST_RIGHT BUTTON_RIGHT
-#define AST_RIGHT_REP (BUTTON_RIGHT | BUTTON_REPEAT)
+#define AST_LEFT BUTTON_SCROLL_UP
+#define AST_LEFT_REP (BUTTON_SCROLL_UP | BUTTON_REPEAT)
+#define AST_RIGHT BUTTON_SCROLL_DOWN
+#define AST_RIGHT_REP (BUTTON_SCROLL_DOWN | BUTTON_REPEAT)
#define AST_FIRE BUTTON_SELECT
#define AST_FIRE_REP (BUTTON_SELECT | BUTTON_REPEAT)
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c
index 275cea326e..ae378b07de 100644
--- a/apps/plugins/vu_meter.c
+++ b/apps/plugins/vu_meter.c
@@ -102,8 +102,8 @@ PLUGIN_HEADER
#define VUMETER_MENU_EXIT2 BUTTON_POWER
#define VUMETER_LEFT BUTTON_LEFT
#define VUMETER_RIGHT BUTTON_RIGHT
-#define VUMETER_UP BUTTON_UP
-#define VUMETER_DOWN BUTTON_DOWN
+#define VUMETER_UP BUTTON_SCROLL_DOWN
+#define VUMETER_DOWN BUTTON_SCROLL_UP
#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
#define VUMETER_QUIT BUTTON_POWER
@@ -480,10 +480,12 @@ void change_settings(void)
break;
case VUMETER_UP:
+ case VUMETER_UP|BUTTON_REPEAT:
selected_setting == 3 ? selected_setting=0 : selected_setting++;
break;
case VUMETER_DOWN:
+ case VUMETER_DOWN|BUTTON_REPEAT:
selected_setting == 0 ? selected_setting=3 : selected_setting--;
}
}