17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
* <https://www.gnu.org/licenses/>.
*/
#include "config.h"
#import "OHEvdevExtendedGamepad.h"
#import "OFDictionary.h"
#import "OHEvdevGameController.h"
#import "OHGameControllerDirectionalPad.h"
#import "OHGameControllerEmulatedTriggerButton.h"
#import "OFInvalidArgumentException.h"
@implementation OHEvdevExtendedGamepad
- (instancetype)initWithKeyBits: (unsigned long *)keyBits
evBits: (unsigned long *)evBits
absBits: (unsigned long *)absBits
|
>
<
|
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
* <https://www.gnu.org/licenses/>.
*/
#include "config.h"
#import "OHEvdevExtendedGamepad.h"
#import "OFDictionary.h"
#import "OHEmulatedGameControllerTriggerButton.h"
#import "OHEvdevGameController.h"
#import "OHGameControllerDirectionalPad.h"
#import "OFInvalidArgumentException.h"
@implementation OHEvdevExtendedGamepad
- (instancetype)initWithKeyBits: (unsigned long *)keyBits
evBits: (unsigned long *)evBits
absBits: (unsigned long *)absBits
|
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
}
- (OHGameControllerButton *)leftTriggerButton
{
OHGameControllerAxis *axis = [_axes objectForKey: @"Z"];
if (axis != nil)
return [[[OHGameControllerEmulatedTriggerButton alloc]
initWithName: @"LT"
axis: axis] autorelease];
return [_buttons objectForKey: @"LT"];
}
- (OHGameControllerButton *)rightTriggerButton
{
OHGameControllerAxis *axis = [_axes objectForKey: @"RZ"];
if (axis != nil)
return [[[OHGameControllerEmulatedTriggerButton alloc]
initWithName: @"RT"
axis: axis] autorelease];
return [_buttons objectForKey: @"RT"];
}
- (OHGameControllerButton *)leftThumbstickButton
|
|
|
|
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
}
- (OHGameControllerButton *)leftTriggerButton
{
OHGameControllerAxis *axis = [_axes objectForKey: @"Z"];
if (axis != nil)
return [[[OHEmulatedGameControllerTriggerButton alloc]
initWithName: @"LT"
axis: axis] autorelease];
return [_buttons objectForKey: @"LT"];
}
- (OHGameControllerButton *)rightTriggerButton
{
OHGameControllerAxis *axis = [_axes objectForKey: @"RZ"];
if (axis != nil)
return [[[OHEmulatedGameControllerTriggerButton alloc]
initWithName: @"RT"
axis: axis] autorelease];
return [_buttons objectForKey: @"RT"];
}
- (OHGameControllerButton *)leftThumbstickButton
|