-pascal OSStatus appSwitch(EventHandlerCallRef handlerChain, EventRef event, void* userData) {
- ApplicationController* self = (ApplicationController*)userData;
- NSDictionary* currentApp = [[NSWorkspace sharedWorkspace] activeApplication];
- ProcessSerialNumber psn;
- psn.lowLongOfPSN = [[currentApp objectForKey:@"NSApplicationProcessSerialNumberLow"] longValue];
- psn.highLongOfPSN = [[currentApp objectForKey:@"NSApplicationProcessSerialNumberHigh"] longValue];
- [self->configsController applicationSwitchedTo: [currentApp objectForKey:@"NSApplicationName"] withPsn: psn];
- return noErr;
-}
+// TODO: Active state should probably be in the ConfigsController or
+// JoystickController, not here.