input: don't check modifiers for regular input

This commit is contained in:
Arisotura 2019-07-09 18:39:50 +02:00
parent 36f1e6f475
commit 592e493a7a
2 changed files with 8 additions and 7 deletions

View File

@ -1548,7 +1548,8 @@ void debug(u32 param)
// printf("VRAM %c: %02X\n", 'A'+i, GPU::VRAMCNT[i]); // printf("VRAM %c: %02X\n", 'A'+i, GPU::VRAMCNT[i]);
FILE* FILE*
shit = fopen("debug/manic.bin", "wb"); shit = fopen("debug/party.bin", "wb");
fwrite(ARM9->ITCM, 0x8000, 1, shit);
for (u32 i = 0x02000000; i < 0x02400000; i+=4) for (u32 i = 0x02000000; i < 0x02400000; i+=4)
{ {
u32 val = ARM7Read32(i); u32 val = ARM7Read32(i);

View File

@ -1168,13 +1168,13 @@ void OnAreaDragBroken(uiAreaHandler* handler, uiArea* area)
{ {
} }
bool EventMatchesKey(uiAreaKeyEvent* evt, int val) bool EventMatchesKey(uiAreaKeyEvent* evt, int val, bool checkmod)
{ {
if (val == -1) return false; if (val == -1) return false;
int key = val & 0xFFFF; int key = val & 0xFFFF;
int mod = val >> 16; int mod = val >> 16;
return evt->Scancode == key && evt->Modifiers == mod; return evt->Scancode == key && (!checkmod || evt->Modifiers == mod);
} }
int OnAreaKeyEvent(uiAreaHandler* handler, uiArea* area, uiAreaKeyEvent* evt) int OnAreaKeyEvent(uiAreaHandler* handler, uiArea* area, uiAreaKeyEvent* evt)
@ -1188,11 +1188,11 @@ int OnAreaKeyEvent(uiAreaHandler* handler, uiArea* area, uiAreaKeyEvent* evt)
if (evt->Up) if (evt->Up)
{ {
for (int i = 0; i < 12; i++) for (int i = 0; i < 12; i++)
if (EventMatchesKey(evt, Config::KeyMapping[i])) if (EventMatchesKey(evt, Config::KeyMapping[i], false))
KeyInputMask |= (1<<i); KeyInputMask |= (1<<i);
for (int i = 0; i < HK_MAX; i++) for (int i = 0; i < HK_MAX; i++)
if (EventMatchesKey(evt, Config::HKKeyMapping[i])) if (EventMatchesKey(evt, Config::HKKeyMapping[i], true))
KeyHotkeyMask &= ~(1<<i); KeyHotkeyMask &= ~(1<<i);
} }
else if (!evt->Repeat) else if (!evt->Repeat)
@ -1215,11 +1215,11 @@ int OnAreaKeyEvent(uiAreaHandler* handler, uiArea* area, uiAreaKeyEvent* evt)
} }
for (int i = 0; i < 12; i++) for (int i = 0; i < 12; i++)
if (EventMatchesKey(evt, Config::KeyMapping[i])) if (EventMatchesKey(evt, Config::KeyMapping[i], false))
KeyInputMask &= ~(1<<i); KeyInputMask &= ~(1<<i);
for (int i = 0; i < HK_MAX; i++) for (int i = 0; i < HK_MAX; i++)
if (EventMatchesKey(evt, Config::HKKeyMapping[i])) if (EventMatchesKey(evt, Config::HKKeyMapping[i], true))
KeyHotkeyMask |= (1<<i); KeyHotkeyMask |= (1<<i);
// REMOVE ME // REMOVE ME