From 8f7918d4adb51f7bdccc6b2e71ad6fee4075a81f Mon Sep 17 00:00:00 2001 From: "Zephaniah E. Hull" Date: Wed, 15 Aug 2001 23:04:54 +0000 Subject: [PATCH] Fix the other keypad keys for SDL input. Ditch sensitivity as a name, we now have in_mouse_accel, in_mouse_filter, and in_mouse_pre_accel. --- libs/video/targets/in_common.c | 35 +++++++++++++++++----------------- libs/video/targets/in_sdl.c | 10 +++++----- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/libs/video/targets/in_common.c b/libs/video/targets/in_common.c index 5572cfdd0..93a821544 100644 --- a/libs/video/targets/in_common.c +++ b/libs/video/targets/in_common.c @@ -57,9 +57,9 @@ #include "QF/mathlib.h" cvar_t *_windowed_mouse; -cvar_t *m_filter; -cvar_t *in_pre_sensitivity; -cvar_t *sensitivity; +cvar_t *in_mouse_filter; +cvar_t *in_mouse_pre_accel; +cvar_t *in_mouse_accel; cvar_t *lookstrafe; cvar_t *in_freelook; @@ -96,18 +96,19 @@ IN_Move (void) if (!in_mouse_avail) return; - in_mouse_x *= in_pre_sensitivity->value; - in_mouse_y *= in_pre_sensitivity->value; + in_mouse_x *= in_mouse_pre_accel->value; + in_mouse_y *= in_mouse_pre_accel->value; - if (m_filter->int_val) { + if (in_mouse_filter->int_val) { in_mouse_x = (in_mouse_x + in_old_mouse_x) * 0.5; in_mouse_y = (in_mouse_y + in_old_mouse_y) * 0.5; - } - in_old_mouse_x = in_mouse_x; - in_old_mouse_y = in_mouse_y; - in_mouse_x *= sensitivity->value; - in_mouse_y *= sensitivity->value; + in_old_mouse_x = in_mouse_x; + in_old_mouse_y = in_mouse_y; + } + + in_mouse_x *= in_mouse_accel->value; + in_mouse_y *= in_mouse_accel->value; if ((in_strafe.state & 1) || (lookstrafe->int_val && freelook)) viewdelta.position[0] += in_mouse_x; @@ -154,17 +155,17 @@ IN_Init_Cvars (void) JOY_Init_Cvars (); _windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, NULL, "With this set to 1, quake will grab the mouse from X"); - m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, NULL, - "Toggle mouse input filtering."); in_freelook = Cvar_Get ("freelook", "0", CVAR_ARCHIVE, NULL, "force +mlook"); lookstrafe = Cvar_Get ("lookstrafe", "0", CVAR_ARCHIVE, NULL, "when mlook/klook on player will strafe"); - in_pre_sensitivity = Cvar_Get ("in_pre_sensitivity", "3", CVAR_ARCHIVE, - NULL, "mouse sensitivity multiplier (pre m_filter)"); - sensitivity = Cvar_Get ("sensitivity", "3", CVAR_ARCHIVE, NULL, - "mouse sensitivity multiplier"); + in_mouse_filter = Cvar_Get ("in_mouse_filter", "0", CVAR_ARCHIVE, NULL, + "Toggle mouse input filtering."); + in_mouse_pre_accel = Cvar_Get ("in_mouse_pre_accel", "1", CVAR_ARCHIVE, + NULL, "mouse in_mouse_pre_accel multiplier"); + in_mouse_accel = Cvar_Get ("in_mouse_accel", "3", CVAR_ARCHIVE, NULL, + "mouse in_mouse_accel multiplier"); IN_LL_Init_Cvars (); } diff --git a/libs/video/targets/in_sdl.c b/libs/video/targets/in_sdl.c index 833c17a8b..5c11f42ac 100644 --- a/libs/video/targets/in_sdl.c +++ b/libs/video/targets/in_sdl.c @@ -231,19 +231,19 @@ IN_LL_SendKeyEvents (void) sym = SDLK_PERIOD; break; case SDLK_KP_DIVIDE: - sym = SDLK_SLASH; + sym = KP_DIVIDE; break; case SDLK_KP_MULTIPLY: - sym = SDLK_ASTERISK; + sym = KP_MULTIPLY; break; case SDLK_KP_MINUS: - sym = SDLK_MINUS; + sym = KP_MINUS; break; case SDLK_KP_PLUS: - sym = SDLK_PLUS; + sym = KP_PLUS; break; case SDLK_KP_ENTER: - sym = SDLK_RETURN; + sym = KP_ENTER; break; case SDLK_KP_EQUALS: sym = SDLK_EQUALS;