From a25a1fc66aa0884a2f3ee18c469f8dcde7dcda71 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Sun, 5 Oct 2014 20:55:59 +0200 Subject: [PATCH] (Apple HID) Cleanup --- input/apple_joypad_hid.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/input/apple_joypad_hid.c b/input/apple_joypad_hid.c index 79fee752e5..e16c9876d1 100644 --- a/input/apple_joypad_hid.c +++ b/input/apple_joypad_hid.c @@ -102,11 +102,12 @@ static void hid_device_input_callback(void* context, IOReturn result, case kIOHIDElementTypeInput_Button: { CFIndex state = IOHIDValueGetIntegerValue(value); + unsigned id = use - 1; if (state) - apple->buttons[connection->slot] |= (1 << (use - 1)); + apple->buttons[connection->slot] |= (1 << id); else - apple->buttons[connection->slot] &= ~(1 << (use - 1)); + apple->buttons[connection->slot] &= ~(1 << id); } break; }