diff --git a/prboom2/src/SDL/i_video.c b/prboom2/src/SDL/i_video.c index ac8fae201..055fa8757 100644 --- a/prboom2/src/SDL/i_video.c +++ b/prboom2/src/SDL/i_video.c @@ -361,19 +361,22 @@ static void I_GetEvent(void) case SDL_MOUSEWHEEL: if (mouse_enabled && window_focused) { - if (Event->wheel.y > 0) - { - event.data1.i = KEYD_MWHEELUP; - - event.type = ev_keydown; - D_PostEvent(&event); + int mouseb; - event.type = ev_keyup; - D_PostEvent(&event); - } + if (Event->wheel.y > 0) + mouseb = KEYD_MWHEELUP; else if (Event->wheel.y < 0) + mouseb = KEYD_MWHEELDOWN; + else if (Event->wheel.x < 0) + mouseb = KEYD_MWHEELLEFT; + else if (Event->wheel.x > 0) + mouseb = KEYD_MWHEELRIGHT; + else + mouseb = 0; + + if(mouseb) { - event.data1.i = KEYD_MWHEELDOWN; + event.data1.i = mouseb; event.type = ev_keydown; D_PostEvent(&event); diff --git a/prboom2/src/doomdef.h b/prboom2/src/doomdef.h index 1b71a57e2..c5b43c9b2 100644 --- a/prboom2/src/doomdef.h +++ b/prboom2/src/doomdef.h @@ -396,6 +396,8 @@ typedef enum { #define KEYD_MOUSE3 (0x80 + 0x62) #define KEYD_MWHEELUP (0x80 + 0x6b) #define KEYD_MWHEELDOWN (0x80 + 0x6c) +#define KEYD_MWHEELLEFT (0X80 + 0X6d) +#define KEYD_MWHEELRIGHT (0X80 + 0X6e) // phares 3/20/98: // diff --git a/prboom2/src/m_menu.c b/prboom2/src/m_menu.c index f62e9a6ec..95b87eb10 100644 --- a/prboom2/src/m_menu.c +++ b/prboom2/src/m_menu.c @@ -3993,6 +3993,8 @@ int M_GetKeyString(int c,int offset) case KEYD_PAUSE: s = "PAUS"; break; case KEYD_MWHEELDOWN: s = "MWDN"; break; case KEYD_MWHEELUP: s = "MWUP"; break; + case KEYD_MWHEELLEFT: s = "MWLT"; break; + case KEYD_MWHEELRIGHT: s = "MWRT"; break; case KEYD_PRINTSC: s = "PRSC"; break; case 0: s = "NONE"; break; default: s = "JUNK"; break;