add config key and input binding to disable vertical mouse movement (#430)

This commit is contained in:
Fabian Greffrath 2022-01-26 15:59:16 +01:00 committed by GitHub
parent db6e211bc6
commit 4fc2603252
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 3 deletions

View File

@ -122,6 +122,7 @@ wbstartstruct_t wminfo; // parms for world map / intermission
boolean haswolflevels = false;// jff 4/18/98 wolf levels present boolean haswolflevels = false;// jff 4/18/98 wolf levels present
byte *savebuffer; byte *savebuffer;
int autorun = false; // always running? // phares int autorun = false; // always running? // phares
int novert = false;
int default_complevel; int default_complevel;
@ -470,7 +471,10 @@ void G_BuildTiccmd(ticcmd_t* cmd)
cmd->buttons |= BT_USE; cmd->buttons |= BT_USE;
} }
if (!novert)
{
forward += mousey; forward += mousey;
}
if (strafe) if (strafe)
side += mousex*2; side += mousex*2;
else else

View File

@ -79,6 +79,7 @@ extern int key_escape;
extern int key_enter; extern int key_enter;
extern int key_help; extern int key_help;
extern int autorun; // always running? // phares extern int autorun; // always running? // phares
extern int novert;
extern int defaultskill; //jff 3/24/98 default skill extern int defaultskill; //jff 3/24/98 default skill
extern boolean haswolflevels; //jff 4/18/98 wolf levels present extern boolean haswolflevels; //jff 4/18/98 wolf levels present

View File

@ -39,6 +39,7 @@ enum
input_speed, input_speed,
input_strafe, input_strafe,
input_autorun, input_autorun,
input_novert,
input_reverse, input_reverse,
input_use, input_use,
input_fire, input_fire,

View File

@ -2718,10 +2718,11 @@ setup_menu_t keys_settings1[] = // Key Binding screen strings
{"RUN" ,S_INPUT ,m_scrn,KB_X,KB_Y+8*8,{0},input_speed}, {"RUN" ,S_INPUT ,m_scrn,KB_X,KB_Y+8*8,{0},input_speed},
{"STRAFE" ,S_INPUT ,m_scrn,KB_X,KB_Y+9*8,{0},input_strafe}, {"STRAFE" ,S_INPUT ,m_scrn,KB_X,KB_Y+9*8,{0},input_strafe},
{"AUTORUN" ,S_INPUT ,m_scrn,KB_X,KB_Y+10*8,{0},input_autorun}, {"AUTORUN" ,S_INPUT ,m_scrn,KB_X,KB_Y+10*8,{0},input_autorun},
{"VERTICAL MOUSE",S_INPUT ,m_scrn,KB_X,KB_Y+11*8,{0},input_novert},
{"TURN LEFT" ,S_INPUT ,m_scrn,KB_X,KB_Y+12*8,{0},input_turnleft}, {"TURN LEFT" ,S_INPUT ,m_scrn,KB_X,KB_Y+13*8,{0},input_turnleft},
{"TURN RIGHT" ,S_INPUT ,m_scrn,KB_X,KB_Y+13*8,{0},input_turnright}, {"TURN RIGHT" ,S_INPUT ,m_scrn,KB_X,KB_Y+14*8,{0},input_turnright},
{"180 TURN" ,S_INPUT ,m_scrn,KB_X,KB_Y+14*8,{0},input_reverse}, {"180 TURN" ,S_INPUT ,m_scrn,KB_X,KB_Y+15*8,{0},input_reverse},
// Button for resetting to defaults // Button for resetting to defaults
{0,S_RESET,m_null,X_BUTTON,Y_BUTTON}, {0,S_RESET,m_null,X_BUTTON,Y_BUTTON},
@ -4831,6 +4832,13 @@ boolean M_Responder (event_t* ev)
return true; return true;
} }
if (M_InputActivated(input_novert))
{
novert = !novert;
dprintf("Vertical Mouse %s", !novert ? "On" : "Off");
return true;
}
if (ch == key_help) // Help key if (ch == key_help) // Help key
{ {
M_StartControlPanel (); M_StartControlPanel ();

View File

@ -426,6 +426,13 @@ default_t defaults[] = {
"1 to enable autorun" "1 to enable autorun"
}, },
{
"novert",
(config_t *) &novert, NULL,
{0}, {0,1}, number, ss_none, wad_no,
"1 to disable vertical mouse movement"
},
{ // killough 2/21/98: default to 10 { // killough 2/21/98: default to 10
"screenblocks", "screenblocks",
(config_t *) &screenblocks, NULL, (config_t *) &screenblocks, NULL,
@ -935,6 +942,14 @@ default_t defaults[] = {
{input_type_joyb, CONTROLLER_LEFT_STICK} } {input_type_joyb, CONTROLLER_LEFT_STICK} }
}, },
{
"input_novert",
NULL, NULL,
{0}, {UL,UL}, input, ss_keys, wad_no,
"key to toggle vertical mouse movement",
input_novert, { {0, 0} }
},
{ {
"input_chat", "input_chat",
NULL, NULL, NULL, NULL,