ObjFW  Diff

Differences From Artifact [c90245aab6]:

To Artifact [5529e3d7e0]:


27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
27
28
29
30
31
32
33





34
35
36
37
38
39
40







-
-
-
-
-








@implementation OHEvdevDualSense
- (OFDictionary OF_GENERIC(OFString *, OHGameControllerButton *) *)buttons
{
	OFMutableDictionary *buttons =
	    [[_rawProfile.buttons mutableCopy] autorelease];

	[buttons removeObjectForKey: @"D-Pad Up"];
	[buttons removeObjectForKey: @"D-Pad Down"];
	[buttons removeObjectForKey: @"D-Pad Left"];
	[buttons removeObjectForKey: @"D-Pad Right"];

	[buttons setObject: self.leftTriggerButton forKey: @"L2"];
	[buttons setObject: self.rightTriggerButton forKey: @"R2"];

	[buttons makeImmutable];

	return buttons;
}
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
62
63
64
65
66
67
68





69
70


71

72
73
74
75





76
77


78

79
80
81
82
83
84
85







-
-
-
-
-
+
+
-
-
+
-




-
-
-
-
-
+
+
-
-
+
-







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

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

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

		    axis: [_rawProfile.axes objectForKey: @"Z"]] autorelease];
	return [_rawProfile.buttons objectForKey: @"L2"];
}

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

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

		    axis: [_rawProfile.axes objectForKey: @"RZ"]] autorelease];
	return [_rawProfile.buttons objectForKey: @"R2"];
}

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