Added alt+enter fullscreen keybind

This commit is contained in:
Marcus Minhorst 2025-08-11 12:34:42 -04:00 committed by Rachael Alexanderson
commit daff54fe1c
4 changed files with 26 additions and 10 deletions

View file

@ -34,15 +34,19 @@
*/
#include "c_bind.h"
#include "d_eventbase.h"
#include "c_console.h"
#include "c_cvars.h"
#include "d_eventbase.h"
#include "d_gui.h"
#include "menu.h"
#include "utf8.h"
#include "m_joy.h"
#include "vm.h"
#include "gamestate.h"
#include "i_interface.h"
#include "keydef.h"
#include "m_joy.h"
#include "menu.h"
#include "utf8.h"
#include "vm.h"
extern bool ToggleFullscreen;
int eventhead;
int eventtail;
@ -73,6 +77,7 @@ void D_ProcessEvents (void)
while (eventtail != eventhead)
{
event_t *ev = &events[eventtail];
eventtail = (eventtail + 1) & (MAXEVENTS - 1);
if (ev->type == EV_KeyUp && keywasdown[ev->data1])
@ -86,6 +91,16 @@ void D_ProcessEvents (void)
if (ev->type == EV_DeviceChange)
UpdateJoystickMenu(I_UpdateDeviceList());
#if defined(__linux__) || defined(_WIN32)
// I cannot test on macos, so it is disabled for now
if ((ev->type == EV_KeyDown && ev->data1 == KEY_ENTER && (ev->data3 & GKM_ALT))
|| (ev->type == EV_GUI_Event && ev->subtype == EV_GUI_KeyDown && ev->data1 == GK_RETURN && (ev->data3 & GKM_ALT)))
{
ToggleFullscreen = !ToggleFullscreen;
continue;
}
#endif
// allow the game to intercept Escape before dispatching it.
if (ev->type != EV_KeyDown || ev->data1 != KEY_ESCAPE || !sysCallbacks.WantEscape || !sysCallbacks.WantEscape())
{