aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Input
diff options
context:
space:
mode:
authorMary <me@thog.eu>2021-05-02 22:01:30 +0200
committerGitHub <noreply@github.com>2021-05-02 22:01:30 +0200
commit3443023a0844822f4f320ea4f75d9522fb5bbc01 (patch)
treea86a0d7b7d3af8d15daa6a94af680f9eff79593b /Ryujinx.Input
parent0e9823d7e6668731598b6f04b551efa801969e7b (diff)
hid: Rewrite shared memory management (#2257)
* hid: Rewrite shared memory management This entirely rewrite our ancient (and original) HID shared memory interface to be more usable and accurate. HID update logics were updated to reflect those changes but should work still the same way it previously did. This need heavy testing just in case to avoid possible regressions. * Silence warnings * Address gdkchan's comments * Address Ac_K's comments * Address one missing nit
Diffstat (limited to 'Ryujinx.Input')
-rw-r--r--Ryujinx.Input/HLE/NpadController.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Ryujinx.Input/HLE/NpadController.cs b/Ryujinx.Input/HLE/NpadController.cs
index d3553d64..e1a8e2d7 100644
--- a/Ryujinx.Input/HLE/NpadController.cs
+++ b/Ryujinx.Input/HLE/NpadController.cs
@@ -456,14 +456,14 @@ namespace Ryujinx.Input.HLE
KeyboardInput hidKeyboard = new KeyboardInput
{
Modifier = 0,
- Keys = new int[0x8]
+ Keys = new ulong[0x4]
};
foreach (HLEKeyboardMappingEntry entry in KeyMapping)
{
- int value = keyboardState.IsPressed(entry.TargetKey) ? 1 : 0;
+ ulong value = keyboardState.IsPressed(entry.TargetKey) ? 1UL : 0UL;
- hidKeyboard.Keys[entry.Target / 0x20] |= (value << (entry.Target % 0x20));
+ hidKeyboard.Keys[entry.Target / 0x40] |= (value << (entry.Target % 0x40));
}
foreach (HLEKeyboardMappingEntry entry in KeyModifierMapping)