mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 15:22:15 +00:00
Added shortcut to toggle fullscreen on OS X
Press Command+F to toggle fullscreen mode in native OS X backend Set k_allowfullscreentoggle CVAR to false to disable the shortcut
This commit is contained in:
parent
23cfd29dbb
commit
b27fdcffb5
2 changed files with 13 additions and 0 deletions
|
@ -79,6 +79,7 @@ typedef float CGFloat;
|
||||||
// From HIToolbox/Events.h
|
// From HIToolbox/Events.h
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
kVK_ANSI_F = 0x03,
|
||||||
kVK_Return = 0x24,
|
kVK_Return = 0x24,
|
||||||
kVK_Tab = 0x30,
|
kVK_Tab = 0x30,
|
||||||
kVK_Space = 0x31,
|
kVK_Space = 0x31,
|
||||||
|
|
|
@ -57,6 +57,8 @@ CVAR(Bool, use_mouse, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||||
CVAR(Bool, m_noprescale, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
CVAR(Bool, m_noprescale, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||||
CVAR(Bool, m_filter, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
CVAR(Bool, m_filter, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||||
|
|
||||||
|
CVAR(Bool, k_allowfullscreentoggle, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||||
|
|
||||||
CUSTOM_CVAR(Int, mouse_capturemode, 1, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
|
CUSTOM_CVAR(Int, mouse_capturemode, 1, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
|
||||||
{
|
{
|
||||||
if (self < 0)
|
if (self < 0)
|
||||||
|
@ -542,6 +544,16 @@ void ProcessKeyboardEvent(NSEvent* theEvent)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (k_allowfullscreentoggle
|
||||||
|
&& (kVK_ANSI_F == keyCode)
|
||||||
|
&& (NSCommandKeyMask & [theEvent modifierFlags])
|
||||||
|
&& (NSKeyDown == [theEvent type])
|
||||||
|
&& ![theEvent isARepeat])
|
||||||
|
{
|
||||||
|
ToggleFullscreen = !ToggleFullscreen;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (GUICapture)
|
if (GUICapture)
|
||||||
{
|
{
|
||||||
ProcessKeyboardEventInMenu(theEvent);
|
ProcessKeyboardEventInMenu(theEvent);
|
||||||
|
|
Loading…
Reference in a new issue