Index: apps/plugins/doom/d_event.h =================================================================== RCS file: /cvsroot/rockbox/apps/plugins/doom/d_event.h,v retrieving revision 1.1 diff -u -r1.1 d_event.h --- apps/plugins/doom/d_event.h 28 Mar 2006 15:44:01 -0000 1.1 +++ apps/plugins/doom/d_event.h 17 Apr 2006 19:00:42 -0000 @@ -47,7 +47,8 @@ ev_keydown, ev_keyup, ev_mouse, - ev_joystick + ev_joystick, + ev_scroll } evtype_t; // Event structure. Index: apps/plugins/doom/g_game.c =================================================================== RCS file: /cvsroot/rockbox/apps/plugins/doom/g_game.c,v retrieving revision 1.3 diff -u -r1.3 g_game.c --- apps/plugins/doom/g_game.c 16 Apr 2006 23:14:04 -0000 1.3 +++ apps/plugins/doom/g_game.c 17 Apr 2006 19:00:44 -0000 @@ -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 +769,9 @@ joyymove = ev->data3; return true; // eat events + case ev_scroll: + scrollmag = ev->data1; + default: break; } Index: apps/plugins/doom/i_video.c =================================================================== RCS file: /cvsroot/rockbox/apps/plugins/doom/i_video.c,v retrieving revision 1.15 diff -u -r1.15 i_video.c --- apps/plugins/doom/i_video.c 16 Apr 2006 23:14:04 -0000 1.15 +++ apps/plugins/doom/i_video.c 17 Apr 2006 19:00:45 -0000 @@ -143,7 +143,9 @@ // #if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \ (CONFIG_KEYPAD == IPOD_1G2G_PAD) -//#define DOOMBUTTON_SCROLLWHEEL +#define DOOMBUTTON_SCROLLWHEEL +#define DOOMBUTTON_SCROLLWHEEL_CC BUTTON_SCROLL_BACK +#define DOOMBUTTON_SCROLLWHEEL_CW BUTTON_SCROLL_FWD #define DOOMBUTTON_UP BUTTON_MENU #define DOOMBUTTON_WEAPON BUTTON_SELECT @@ -177,6 +179,26 @@ holdbutton=rb->button_hold(); #endif +#ifdef DOOMBUTTON_SCROLLWHEEL + /* use button_get(false) for clickwheel checks */ + int button; /* move me */ + button = rb->button_get(false); + switch(button){ + case DOOMBUTTON_SCROLLWHEEL_CC | BUTTON_REPEAT: + case DOOMBUTTON_SCROLLWHEEL_CC: + event.type = ev_scroll; + event.data1=-1; + D_PostEvent(&event); + break; + case DOOMBUTTON_SCROLLWHEEL_CW | BUTTON_REPEAT: + case DOOMBUTTON_SCROLLWHEEL_CW: + event.type = ev_scroll; + //event.data1=KEY_LEFTARROW; + event.data1=1; + D_PostEvent(&event); + break; + } +#endif newbuttonstate = rb->button_status(); released = ~newbuttonstate & oldbuttonstate; pressed = newbuttonstate & ~oldbuttonstate;