Make sure reports are only sent from one thread
[NSCursor unhide];
}
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [lastController setRumbleAmplitude:0];
+ [self setRumble:0];
[JOYController unregisterListener:self];
}
- (instancetype)initWithCoder:(NSCoder *)coder
- (void)setRumble:(double)amp
{
+ dispatch_async(dispatch_get_main_queue(), ^{
[lastController setRumbleAmplitude:amp];
+ });
}
- (void)controller:(JOYController *)controller movedAxis:(JOYAxis *)axis
{
if (![self.window isMainWindow]) return;
if (controller != lastController) {
- [lastController setRumbleAmplitude:0];
+ [self setRumble:0];
lastController = controller;
}
![preferred_joypad isEqualToString:controller.uniqueID]) {
continue;
}
+ dispatch_async(dispatch_get_main_queue(), ^{
[controller setPlayerLEDs:1 << player];
+ });
NSDictionary *mapping = [[NSUserDefaults standardUserDefaults] dictionaryForKey:@"JoyKitInstanceMapping"][controller.uniqueID];
if (!mapping) {
mapping = [[NSUserDefaults standardUserDefaults] dictionaryForKey:@"JoyKitNameMapping"][controller.deviceName];
