attempt at syncing pause command between instances. works somewhat

This commit is contained in:
Arisotura
2023-02-15 18:24:24 +01:00
parent 5aa378d316
commit ea951d092e
5 changed files with 124 additions and 2 deletions

View File

@ -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;
}