21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#import <GameController/GameController.h>
#import "OHGCFGameController.h"
#import "NSString+OFObject.h"
#import "OFArray.h"
#import "OFDictionary.h"
#import "OHDualSenseGamepad.h"
#import "OHDualSenseGamepad+Private.h"
#import "OHGCFGameControllerProfile.h"
#import "OHGameController.h"
#import "OHGameController+Private.h"
#import "OHGameControllerAxis.h"
#import "OHGameControllerButton.h"
|
>
|
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#import <GameController/GameController.h>
#import "OHGCFGameController.h"
#import "NSString+OFObject.h"
#import "OFArray.h"
#import "OFDictionary.h"
#import "OFSet.h"
#import "OHDualSenseGamepad.h"
#import "OHDualSenseGamepad+Private.h"
#import "OHGCFGameControllerProfile.h"
#import "OHGameController.h"
#import "OHGameController+Private.h"
#import "OHGameControllerAxis.h"
#import "OHGameControllerButton.h"
|
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
}
- (void)updateState
{
void *pool = objc_autoreleasePoolPush();
id <GCDevicePhysicalInputState> snapshot =
[_controller.input.unmappedInput capture];
for (id <GCPhysicalInputElement> element in snapshot.elements) {
if ([element conformsToProtocol: @protocol(GCButtonElement)]) {
OHGameControllerButton *button =
_profile.oh_buttonsMap[element.localizedName];
OFAssert(button != nil);
button.value = ((id <GCButtonElement>)element)
.pressedInput.value;
|
>
>
>
|
>
|
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
}
- (void)updateState
{
void *pool = objc_autoreleasePoolPush();
id <GCDevicePhysicalInputState> snapshot =
[_controller.input.unmappedInput capture];
OFSet *filteredButtons =
([_profile respondsToSelector: @selector(oh_filteredButtons)]
? _profile.oh_filteredButtons : [OFSet set]);
for (id <GCPhysicalInputElement> element in snapshot.elements) {
if ([element conformsToProtocol: @protocol(GCButtonElement)] &&
![filteredButtons containsObject: element.localizedName]) {
OHGameControllerButton *button =
_profile.oh_buttonsMap[element.localizedName];
OFAssert(button != nil);
button.value = ((id <GCButtonElement>)element)
.pressedInput.value;
|