Use defaults behavior instead of hardcoded keys for most controls
Same behavior if you leave the controls at their defaults or unbind them, but now if you bind them to some other key then the default keys they use are freed up (a bit jank tho for screenshot keys...)
This commit is contained in:
parent
20d11760bb
commit
0859c8a710
3 changed files with 7 additions and 11 deletions
|
|
@ -1505,7 +1505,7 @@ static void M_ConfirmConnect(event_t *ev)
|
|||
{
|
||||
if (ev->type == ev_keydown)
|
||||
{
|
||||
if (ev->data1 == ' ' || ev->data1 == 'y' || ev->data1 == KEY_ENTER || G_ControlBoundToKey(0, gc_accelerate, ev->data1, false))
|
||||
if (ev->data1 == ' ' || ev->data1 == 'y' || ev->data1 == KEY_ENTER || (ev->device != 0 && G_ControlBoundToKey(0, gc_accelerate, ev->data1, true)))
|
||||
{
|
||||
if (totalfilesrequestednum > 0)
|
||||
{
|
||||
|
|
@ -1532,7 +1532,7 @@ static void M_ConfirmConnect(event_t *ev)
|
|||
|
||||
M_ClearMenus(true);
|
||||
}
|
||||
else if (ev->data1 == 'n' || ev->data1 == KEY_ESCAPE || G_ControlBoundToKey(0, gc_brake, ev->data1, false))
|
||||
else if (ev->data1 == 'n' || ev->data1 == KEY_ESCAPE || (ev->device != 0 && G_ControlBoundToKey(0, gc_brake, ev->data1, true)))
|
||||
{
|
||||
cl_mode = CL_ABORTED;
|
||||
M_ClearMenus(true);
|
||||
|
|
|
|||
10
src/g_game.c
10
src/g_game.c
|
|
@ -1536,7 +1536,7 @@ boolean G_Responder(event_t *ev)
|
|||
|
||||
// allow spy mode changes even during the demo
|
||||
if (gamestate == GS_LEVEL && ev->type == ev_keydown
|
||||
&& (ev->data1 == KEY_F12 || G_ControlBoundToKey(0, gc_viewpoint, ev->data1, false)))
|
||||
&& G_ControlBoundToKey(0, gc_viewpoint, ev->data1, true))
|
||||
{
|
||||
if (!demo.playback && (r_splitscreen))
|
||||
g_localplayers[0] = consoleplayer;
|
||||
|
|
@ -1571,10 +1571,7 @@ boolean G_Responder(event_t *ev)
|
|||
}
|
||||
|
||||
// Allow pausing
|
||||
if (
|
||||
G_ControlBoundToKey(0, gc_pause, ev->data1, false)
|
||||
|| ev->data1 == KEY_PAUSE
|
||||
)
|
||||
if (G_ControlBoundToKey(0, gc_pause, ev->data1, true))
|
||||
{
|
||||
paused = !paused;
|
||||
|
||||
|
|
@ -1607,8 +1604,7 @@ boolean G_Responder(event_t *ev)
|
|||
switch (ev->type)
|
||||
{
|
||||
case ev_keydown:
|
||||
if (G_ControlBoundToKey(0, gc_pause, ev->data1, false)
|
||||
|| ev->data1 == KEY_PAUSE)
|
||||
if (G_ControlBoundToKey(0, gc_pause, ev->data1, true))
|
||||
{
|
||||
if (modeattacking && !demo.playback && (gamestate == GS_LEVEL))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1617,9 +1617,9 @@ boolean M_ScreenshotResponder(event_t *ev)
|
|||
if (ch >= NUMKEYS && menuactive) // If it's not a keyboard key, then don't allow it in the menus!
|
||||
return false;
|
||||
|
||||
if (ch == KEY_F8 || G_ControlBoundToKey(0, gc_screenshot, ch, false)) // remappable F8
|
||||
if (G_ControlBoundToKey(0, gc_screenshot, ch, true))
|
||||
M_ScreenShot();
|
||||
else if (ch == KEY_F9 || G_ControlBoundToKey(0, gc_recordgif, ch, false)) // remappable F9
|
||||
else if (G_ControlBoundToKey(0, gc_recordgif, ch, true))
|
||||
((moviemode) ? M_StopMovie : M_StartMovie)();
|
||||
else
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue