Make the mousewheel work

This commit is contained in:
Tim Angus 2013-01-17 19:04:27 +00:00
parent f478761e07
commit 61ed67bd1a

View file

@ -756,10 +756,8 @@ static void IN_ProcessEvents( void )
case 1: b = K_MOUSE1; break; case 1: b = K_MOUSE1; break;
case 2: b = K_MOUSE3; break; case 2: b = K_MOUSE3; break;
case 3: b = K_MOUSE2; break; case 3: b = K_MOUSE2; break;
case 4: b = K_MWHEELUP; break; case 4: b = K_MOUSE4; break;
case 5: b = K_MWHEELDOWN; break; case 5: b = K_MOUSE5; break;
case 6: b = K_MOUSE4; break;
case 7: b = K_MOUSE5; break;
default: b = K_AUX1 + ( e.button.button - 8 ) % 16; break; default: b = K_AUX1 + ( e.button.button - 8 ) % 16; break;
} }
Com_QueueEvent( 0, SE_KEY, b, Com_QueueEvent( 0, SE_KEY, b,
@ -767,6 +765,13 @@ static void IN_ProcessEvents( void )
} }
break; break;
case SDL_MOUSEWHEEL:
if( e.wheel.y > 0 )
Com_QueueEvent( 0, SE_KEY, K_MWHEELUP, qtrue, 0, NULL );
else
Com_QueueEvent( 0, SE_KEY, K_MWHEELDOWN, qtrue, 0, NULL );
break;
case SDL_QUIT: case SDL_QUIT:
Cbuf_ExecuteText(EXEC_NOW, "quit Closed window\n"); Cbuf_ExecuteText(EXEC_NOW, "quit Closed window\n");
break; break;