ObjFW  Diff

Differences From Artifact [7696fc6d10]:

To Artifact [c90245aab6]:


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 "OHEvdevDualSense.h"
#import "OFDictionary.h"
#import "OFNumber.h"
#import "OHEvdevGameController.h"
#import "OHGameControllerDirectionalPad.h"
#import "OHGameControllerEmulatedTriggerButton.h"

#import "OFInvalidArgumentException.h"

@implementation OHEvdevDualSense
- (OFDictionary OF_GENERIC(OFString *, OHGameControllerButton *) *)buttons
{







<
<
<







17
18
19
20
21
22
23



24
25
26
27
28
29
30
 * <https://www.gnu.org/licenses/>.
 */

#include "config.h"

#import "OHEvdevDualSense.h"
#import "OFDictionary.h"



#import "OHGameControllerEmulatedTriggerButton.h"

#import "OFInvalidArgumentException.h"

@implementation OHEvdevDualSense
- (OFDictionary OF_GENERIC(OFString *, OHGameControllerButton *) *)buttons
{
67
68
69
70
71
72
73
























74
75
76
77
78
79
80
	return [_rawProfile.buttons objectForKey: @"Circle"];
}

- (OHGameControllerButton *)leftShoulderButton
{
	return [_rawProfile.buttons objectForKey: @"L1"];
}

























- (OHGameControllerButton *)rightShoulderButton
{
	return [_rawProfile.buttons objectForKey: @"R1"];
}

- (OHGameControllerButton *)leftThumbstickButton







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
	return [_rawProfile.buttons objectForKey: @"Circle"];
}

- (OHGameControllerButton *)leftShoulderButton
{
	return [_rawProfile.buttons objectForKey: @"L1"];
}

- (OHGameControllerButton *)leftTriggerButton
{
	OHGameControllerAxis *axis = [_rawProfile.axes objectForKey: @"Z"];

	if (axis != nil)
		return [[[OHGameControllerEmulatedTriggerButton alloc]
		    initWithName: @"L2"
			    axis: axis] autorelease];

	return [_rawProfile.buttons objectForKey: @"L2"];
}

- (OHGameControllerButton *)rightTriggerButton
{
	OHGameControllerAxis *axis = [_rawProfile.axes objectForKey: @"RZ"];

	if (axis != nil)
		return [[[OHGameControllerEmulatedTriggerButton alloc]
		    initWithName: @"R2"
			    axis: axis] autorelease];

	return [_rawProfile.buttons objectForKey: @"R2"];
}

- (OHGameControllerButton *)rightShoulderButton
{
	return [_rawProfile.buttons objectForKey: @"R1"];
}

- (OHGameControllerButton *)leftThumbstickButton