summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2014-09-13 22:59:44 -0400
committercomex <comexk@gmail.com>2014-09-13 22:59:44 -0400
commit0b44795cf3b67d340e8fe698f20d02fd7f4554b2 (patch)
tree5c3af0493249468f35dd534aad68388bf52e109f /Source/Core/InputCommon/ControllerInterface
parentd7b7487405c94c9677c73ced26563053259d5b82 (diff)
parent6cfc5b98492c50837f37d54176b982fbc5bbb912 (diff)
Merge pull request #1079 from lioncash/lol-objc
InputCommon: Initialize NSDictionaries using literal syntax.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm19
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm12
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);