diff options
author | Arisotura <thetotalworm@gmail.com> | 2019-07-09 18:39:50 +0200 |
---|---|---|
committer | Arisotura <thetotalworm@gmail.com> | 2019-07-09 18:39:50 +0200 |
commit | 592e493a7aae701957d1a5c05ef8d31c5187ed8c (patch) | |
tree | e99ef629f63ebee02c670473d39ee5be792300c7 /src | |
parent | 36f1e6f475a2102d1f931423903dc327bf076e9d (diff) |
input: don't check modifiers for regular input
Diffstat (limited to 'src')
-rw-r--r-- | src/NDS.cpp | 3 | ||||
-rw-r--r-- | src/libui_sdl/main.cpp | 12 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/NDS.cpp b/src/NDS.cpp index 6272f88..991995d 100644 --- a/src/NDS.cpp +++ b/src/NDS.cpp @@ -1548,7 +1548,8 @@ void debug(u32 param) // printf("VRAM %c: %02X\n", 'A'+i, GPU::VRAMCNT[i]); 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) { u32 val = ARM7Read32(i); diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 99d4e3f..e2d50ff 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -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; int key = val & 0xFFFF; 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) @@ -1188,11 +1188,11 @@ int OnAreaKeyEvent(uiAreaHandler* handler, uiArea* area, uiAreaKeyEvent* evt) if (evt->Up) { for (int i = 0; i < 12; i++) - if (EventMatchesKey(evt, Config::KeyMapping[i])) + if (EventMatchesKey(evt, Config::KeyMapping[i], false)) KeyInputMask |= (1<<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); } else if (!evt->Repeat) @@ -1215,11 +1215,11 @@ int OnAreaKeyEvent(uiAreaHandler* handler, uiArea* area, uiAreaKeyEvent* evt) } for (int i = 0; i < 12; i++) - if (EventMatchesKey(evt, Config::KeyMapping[i])) + if (EventMatchesKey(evt, Config::KeyMapping[i], false)) KeyInputMask &= ~(1<<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); // REMOVE ME |