In linux when in fullscreen, make escape leave fullscreen then pause.

More like on windows?


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5079 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2010-02-18 00:50:08 +00:00
parent 967c5891e9
commit d5c094df75
2 changed files with 16 additions and 7 deletions

View File

@ -269,9 +269,11 @@ void ProcessXEvents(void)
key = XLookupKeysym((XKeyEvent*)&event, 0); key = XLookupKeysym((XKeyEvent*)&event, 0);
if(key == XK_F4 && ((event.xkey.state & Mod1Mask) == Mod1Mask)) if(key == XK_F4 && ((event.xkey.state & Mod1Mask) == Mod1Mask))
Host_Message(WM_USER_STOP); Host_Message(WM_USER_STOP);
else if (key == XK_Escape)
Host_Message(WM_USER_PAUSE);
break; break;
case KeyPress:
key = XLookupKeysym((XKeyEvent*)&event, 0);
if (key == XK_Escape)
Host_Message(WM_USER_PAUSE);
case ClientMessage: case ClientMessage:
if ((ulong) event.xclient.data.l[0] == XInternAtom(dpy, "WM_DELETE_WINDOW", False)) if ((ulong) event.xclient.data.l[0] == XInternAtom(dpy, "WM_DELETE_WINDOW", False))
Host_Message(WM_USER_STOP); Host_Message(WM_USER_STOP);

View File

@ -571,7 +571,7 @@ void OpenGL_Update()
switch(event.type) { switch(event.type) {
case KeyRelease: case KeyRelease:
key = XLookupKeysym((XKeyEvent*)&event, 0); key = XLookupKeysym((XKeyEvent*)&event, 0);
if((key >= XK_F1 && key <= XK_F9) || key == XK_Escape) { if(key >= XK_F1 && key <= XK_F9) {
g_VideoInitialize.pKeyPress(FKeyPressed, ShiftPressed, ControlPressed); g_VideoInitialize.pKeyPress(FKeyPressed, ShiftPressed, ControlPressed);
FKeyPressed = -1; FKeyPressed = -1;
} else { } else {
@ -590,13 +590,20 @@ void OpenGL_Update()
else else
FKeyPressed = key - 0xff4e; FKeyPressed = key - 0xff4e;
} }
else if (key == XK_Return && ((event.xkey.state & Mod1Mask) == Mod1Mask))
ToggleFullscreenMode();
else if (key == XK_Escape) else if (key == XK_Escape)
{ {
if (!GLWin.fs) if (GLWin.fs)
FKeyPressed = 0x1c; {
ToggleFullscreenMode();
XEvent event;
do {
XMaskEvent(GLWin.dpy, StructureNotifyMask, &event);
} while ( (event.type != MapNotify) || (event.xmap.event != GLWin.win) );
} }
g_VideoInitialize.pKeyPress(0x1c, ShiftPressed, ControlPressed);
}
else if (key == XK_Return && ((event.xkey.state & Mod1Mask) == Mod1Mask))
ToggleFullscreenMode();
else { else {
if(key == XK_Shift_L || key == XK_Shift_R) if(key == XK_Shift_L || key == XK_Shift_R)
ShiftPressed = true; ShiftPressed = true;