mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-29 09:10:08 -06:00
attempt at syncing pause command between instances. works somewhat
This commit is contained in:
@ -30,7 +30,7 @@ int JoystickID;
|
||||
SDL_Joystick* Joystick = nullptr;
|
||||
|
||||
u32 KeyInputMask, JoyInputMask;
|
||||
u32 KeyHotkeyMask, JoyHotkeyMask;
|
||||
u32 KeyHotkeyMask, JoyHotkeyMask, ExtHotkeyMask;
|
||||
u32 HotkeyMask, LastHotkeyMask;
|
||||
u32 HotkeyPress, HotkeyRelease;
|
||||
|
||||
@ -45,6 +45,7 @@ void Init()
|
||||
|
||||
KeyHotkeyMask = 0;
|
||||
JoyHotkeyMask = 0;
|
||||
ExtHotkeyMask = 0;
|
||||
HotkeyMask = 0;
|
||||
LastHotkeyMask = 0;
|
||||
}
|
||||
@ -184,6 +185,11 @@ bool JoystickButtonDown(int val)
|
||||
return false;
|
||||
}
|
||||
|
||||
void ExtHotkeyPress(int id)
|
||||
{
|
||||
ExtHotkeyMask |= (1<<id);
|
||||
}
|
||||
|
||||
void Process()
|
||||
{
|
||||
SDL_JoystickUpdate();
|
||||
@ -214,10 +220,11 @@ void Process()
|
||||
if (JoystickButtonDown(Config::HKJoyMapping[i]))
|
||||
JoyHotkeyMask |= (1<<i);
|
||||
|
||||
HotkeyMask = KeyHotkeyMask | JoyHotkeyMask;
|
||||
HotkeyMask = KeyHotkeyMask | JoyHotkeyMask | ExtHotkeyMask;
|
||||
HotkeyPress = HotkeyMask & ~LastHotkeyMask;
|
||||
HotkeyRelease = LastHotkeyMask & ~HotkeyMask;
|
||||
LastHotkeyMask = HotkeyMask;
|
||||
ExtHotkeyMask = 0;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user