Index: apps/plugins/doom/i_video.c =================================================================== --- apps/plugins/doom/i_video.c (revision 13728) +++ apps/plugins/doom/i_video.c (working copy) @@ -150,7 +150,9 @@ // #if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) -//#define DOOMBUTTON_SCROLLWHEEL +#define DOOMBUTTON_SCROLLWHEEL +#define DOOMBUTTON_S_LEFT BUTTON_SCROLL_BACK +#define DOOMBUTTON_S_RIGHT BUTTON_SCROLL_FWD #define DOOMBUTTON_UP BUTTON_MENU #define DOOMBUTTON_WEAPON BUTTON_SELECT #define DOOMBUTTON_LEFT BUTTON_LEFT @@ -214,27 +216,8 @@ #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; @@ -271,10 +254,32 @@ #endif newbuttonstate = rb->button_status(); +//#ifdef DOOMBUTTON_SCROLLWHEEL +// newbuttonstate |= read_scroll_wheel(); +//#endif + #ifdef DOOMBUTTON_SCROLLWHEEL - newbuttonstate |= read_scroll_wheel(); -#endif + /* use button_get(false) for clickwheel checks */ + int button; /* move me */ + button = rb->button_get(false); + switch(button){ + case DOOMBUTTON_S_LEFT | BUTTON_REPEAT: + case DOOMBUTTON_S_LEFT: + event.type = ev_scroll; + event.data1=-1; + D_PostEvent(&event); + break; + case DOOMBUTTON_S_RIGHT | BUTTON_REPEAT: + case DOOMBUTTON_S_RIGHT: + event.type = ev_scroll; + //event.data1=KEY_LEFTARROW; + event.data1=1; + D_PostEvent(&event); + break; + } +#endif + if(newbuttonstate==oldbuttonstate) /* Don't continue, nothing left to do */ return; released = ~newbuttonstate & oldbuttonstate; Index: apps/plugins/doom/g_game.c =================================================================== --- apps/plugins/doom/g_game.c (revision 13728) +++ apps/plugins/doom/g_game.c (working copy) @@ -229,6 +229,9 @@ static unsigned int dclickstate2; static unsigned int dclicks2; +// scrollwheel values +static int scrollmag; + // joystick values are repeated static int joyxmove; static int joyymove; @@ -317,6 +320,13 @@ // let movement keys cancel each other out + /* strafe with scrollwheel */ + if (scrollmag > 0) + side += 5*sidemove[speed]; + if (scrollmag < 0) + side -= 5*sidemove[speed]; + scrollmag = 0; + if (strafe) { if (gamekeydown[key_right]) @@ -757,6 +767,9 @@ joyymove = ev->data3; return true; // eat events + case ev_scroll: + scrollmag = ev->data1; + default: break; } Index: apps/plugins/doom/d_event.h =================================================================== --- apps/plugins/doom/d_event.h (revision 13728) +++ apps/plugins/doom/d_event.h (working copy) @@ -47,7 +47,8 @@ ev_keydown, ev_keyup, ev_mouse, - ev_joystick + ev_joystick, + ev_scroll } evtype_t; // Event structure.