diff options
| author | Lioncash <mathew1800@gmail.com> | 2014-09-13 21:32:33 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2014-09-13 21:32:33 -0400 |
| commit | 6cfc5b98492c50837f37d54176b982fbc5bbb912 (patch) | |
| tree | 5c3af0493249468f35dd534aad68388bf52e109f /Source/Core/InputCommon/ControllerInterface | |
| parent | d7b7487405c94c9677c73ced26563053259d5b82 (diff) | |
InputCommon: Initialize NSDictionaries using literal syntax.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm | 19 | ||||
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm | 12 |
2 files changed, 12 insertions, 19 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm index 10a2c211c1..93dea13c28 100644 --- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm +++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm @@ -22,13 +22,10 @@ Joystick::Joystick(IOHIDDeviceRef device, std::string name, int index) , m_ff_device(nullptr) { // Buttons - NSDictionary *buttonDict = - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithInteger: kIOHIDElementTypeInput_Button], - @kIOHIDElementTypeKey, - [NSNumber numberWithInteger: kHIDPage_Button], - @kIOHIDElementUsagePageKey, - nil]; + NSDictionary *buttonDict = @{ + @kIOHIDElementTypeKey : [NSNumber numberWithInteger: kIOHIDElementTypeInput_Button], + @kIOHIDElementUsagePageKey : [NSNumber numberWithInteger: kHIDPage_Button] + }; CFArrayRef buttons = IOHIDDeviceCopyMatchingElements(m_device, (CFDictionaryRef)buttonDict, kIOHIDOptionsTypeNone); @@ -47,11 +44,9 @@ Joystick::Joystick(IOHIDDeviceRef device, std::string name, int index) } // Axes - NSDictionary *axisDict = - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithInteger: kIOHIDElementTypeInput_Misc], - @kIOHIDElementTypeKey, - nil]; + NSDictionary *axisDict = @{ + @kIOHIDElementTypeKey : [NSNumber numberWithInteger: kIOHIDElementTypeInput_Misc] + }; CFArrayRef axes = IOHIDDeviceCopyMatchingElements(m_device, (CFDictionaryRef)axisDict, kIOHIDOptionsTypeNone); diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm index 98df7c3535..7ff67c0e7f 100644 --- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm +++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm @@ -23,13 +23,11 @@ Keyboard::Keyboard(IOHIDDeviceRef device, std::string name, int index, void *win { // This class should only recieve Keyboard or Keypad devices // Now, filter on just the buttons we can handle sanely - NSDictionary *matchingElements = - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithInteger: kIOHIDElementTypeInput_Button], - @kIOHIDElementTypeKey, - [NSNumber numberWithInteger: 0], @kIOHIDElementMinKey, - [NSNumber numberWithInteger: 1], @kIOHIDElementMaxKey, - nil]; + NSDictionary *matchingElements = @{ + @kIOHIDElementTypeKey : [NSNumber numberWithInteger: kIOHIDElementTypeInput_Button], + @kIOHIDElementMinKey : [NSNumber numberWithInteger: 0], + @kIOHIDElementMaxKey : [NSNumber numberWithInteger: 1] + }; CFArrayRef elements = IOHIDDeviceCopyMatchingElements(m_device, (CFDictionaryRef)matchingElements, kIOHIDOptionsTypeNone); |
