mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
EXPERIMENTAL
Removed X event loops from GCPad and Wiimote plugins, and implemented an asynchronous check for keyboard and mouse buttons. Also added an X event loop in core that handles events while the emulator is paused. Prevents unexpected behavior from events that occur while the emulator is paused. Now there is only one event loop running at a time (besides those hidden in SDL). I will revert this commit if other devs are unhappy with it. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5048 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -297,7 +297,7 @@ int RecordingCheckKeys(int WmNuIr)
|
||||
// Multi System Input Status Check
|
||||
bool IsKey(int Key)
|
||||
{
|
||||
int Ret = NULL;
|
||||
int Ret = false;
|
||||
|
||||
if (WiiMapping[g_ID].Source == 1)
|
||||
{
|
||||
@ -310,7 +310,11 @@ bool IsKey(int Key)
|
||||
#else
|
||||
if (MapKey < 256 || MapKey >= 0xf000)
|
||||
{
|
||||
Ret = KeyStatus[Key]; // Keyboard (Linux)
|
||||
char keys[32];
|
||||
KeyCode keyCode;
|
||||
XQueryKeymap(WMdisplay, keys);
|
||||
keyCode = XKeysymToKeycode(WMdisplay, MapKey);
|
||||
Ret = (keys[keyCode/8] & (1 << (keyCode%8))); // Keyboard (Linux)
|
||||
#endif
|
||||
}
|
||||
else if (MapKey < 0x1100)
|
||||
@ -337,8 +341,28 @@ bool IsKey(int Key)
|
||||
Ret = !(x < 0 || x > 1 || y < 0 || y > 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
#if defined(HAVE_X11) && HAVE_X11
|
||||
if ((Key == EWM_SHAKE) || (Key == EWM_A) || (Key == EWM_B))
|
||||
{
|
||||
Window GLWin = *(Window *)g_WiimoteInitialize.pXWindow;
|
||||
if (GLWin != 0)
|
||||
{
|
||||
int root_x, root_y, win_x, win_y;
|
||||
Window rootDummy, childWin;
|
||||
unsigned int mask;
|
||||
XQueryPointer(WMdisplay, GLWin, &rootDummy, &childWin, &root_x, &root_y, &win_x, &win_y, &mask);
|
||||
if (((Key == EWM_A) && (mask & Button1Mask))
|
||||
|| ((Key == EWM_B) && (mask & Button3Mask))
|
||||
|| ((Key == EWM_SHAKE) && (mask & Button3Mask)))
|
||||
{
|
||||
float x, y;
|
||||
GetMousePos(x, y);
|
||||
Ret = !(x < 0 || x > 1 || y < 0 || y > 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return (Ret) ? true : false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user