From 039de0aa6a5f72811db27c76c5c118c587ca8557 Mon Sep 17 00:00:00 2001 From: stevenaaus Date: Sat, 4 Jan 2014 07:18:43 +0000 Subject: [PATCH] Enable wheel mouse in console (used to scroll up and down). git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@884 af15c1b1-3010-417e-b628-4374ebc0bcbd --- quakespasm/Quake/in_sdl.c | 4 ++-- quakespasm/Quake/keys.c | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/quakespasm/Quake/in_sdl.c b/quakespasm/Quake/in_sdl.c index ffcd2ff7..b47fc13c 100644 --- a/quakespasm/Quake/in_sdl.c +++ b/quakespasm/Quake/in_sdl.c @@ -66,8 +66,8 @@ static int FilterMouseEvents (const SDL_Event *event) switch (event->type) { case SDL_MOUSEMOTION: - case SDL_MOUSEBUTTONDOWN: - case SDL_MOUSEBUTTONUP: + // case SDL_MOUSEBUTTONDOWN: + // case SDL_MOUSEBUTTONUP: return 0; } diff --git a/quakespasm/Quake/keys.c b/quakespasm/Quake/keys.c index c4ce129a..7c580afe 100644 --- a/quakespasm/Quake/keys.c +++ b/quakespasm/Quake/keys.c @@ -322,16 +322,15 @@ void Key_Console (int key) return; case K_PGUP: - // Mouse events never reach the console, especially in windowed mode - // when mouse is released to the window manager - // case K_MWHEELUP: + // To allow (some) mouse events to reach the console, we selectively alter FilterMouseEvents + case K_MWHEELUP: con_backscroll += keydown[K_CTRL] ? ((con_vislines>>3) - 4) : 2; if (con_backscroll > con_totallines - (vid.height>>3) - 1) con_backscroll = con_totallines - (vid.height>>3) - 1; return; case K_PGDN: - // case K_MWHEELDOWN: + case K_MWHEELDOWN: con_backscroll -= keydown[K_CTRL] ? ((con_vislines>>3) - 4) : 2; if (con_backscroll < 0) con_backscroll = 0;