Differences From Artifact [00711b94af]:
- File src/hid/OHEvdevGamepad.m — part of check-in [35e4d04158] at 2024-06-08 19:32:08 on branch trunk — OHGameControllerDirectionalPad: Rename methods (user: js, size: 6364) [annotate] [blame] [check-ins using]
To Artifact [fbbf92a317]:
- File
src/hid/OHEvdevGamepad.m
— part of check-in
[48e6a99f7b]
at
2024-06-08 22:16:16
on branch trunk
— OHEvdevGamepad: Filter buttons/axes
This is instead of replacing them altogether, which means the button
names are kept and extra buttons are not removed. (user: js, size: 6577) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
38 39 40 41 42 43 44 | _rawProfile = [controller.rawProfile retain]; if (self.northButton == nil || self.southButton == nil || self.westButton == nil || self.eastButton == nil || self.leftShoulderButton == nil || self.rightShoulderButton == nil || self.leftTriggerButton == nil || | | < < < | | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | _rawProfile = [controller.rawProfile retain]; if (self.northButton == nil || self.southButton == nil || self.westButton == nil || self.eastButton == nil || self.leftShoulderButton == nil || self.rightShoulderButton == nil || self.leftTriggerButton == nil || self.rightTriggerButton == nil || self.menuButton == nil || self.optionsButton == nil || self.leftThumbstick == nil || self.rightThumbstick == nil || self.dPad == nil) @throw [OFInvalidArgumentException exception]; objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; |
︙ | ︙ | |||
64 65 66 67 68 69 70 | [_rawProfile release]; [super dealloc]; } - (OFDictionary OF_GENERIC(OFString *, OHGameControllerButton *) *)buttons { | | | | | | | > | > | | > | | | | | > > > > > > > > > > > > > > | | 61 62 63 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 102 103 104 105 106 107 108 109 110 | [_rawProfile release]; [super dealloc]; } - (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"]; if ([_rawProfile.axes objectForKey: @"Z"] != nil) [buttons setObject: self.leftTriggerButton forKey: @"TL2"]; if ([_rawProfile.axes objectForKey: @"RZ"] != nil) [buttons setObject: self.rightTriggerButton forKey: @"TR2"]; [buttons makeImmutable]; return buttons; } - (OFDictionary OF_GENERIC(OFString *, OHGameControllerAxis *) *)axes { OFMutableDictionary *axes = [[_rawProfile.axes mutableCopy] autorelease]; [axes removeObjectForKey: @"X"]; [axes removeObjectForKey: @"Y"]; [axes removeObjectForKey: @"RX"]; [axes removeObjectForKey: @"RY"]; [axes removeObjectForKey: @"Z"]; [axes removeObjectForKey: @"RZ"]; [axes removeObjectForKey: @"HAT0X"]; [axes removeObjectForKey: @"HAT0Y"]; [axes makeImmutable]; return axes; } - (OFDictionary OF_GENERIC(OFString *, OHGameControllerDirectionalPad *) *) directionalPads { return [OFDictionary dictionaryWithKeysAndObjects: @"Left Thumbstick", self.leftThumbstick, |
︙ | ︙ |