return @{ @"type": self.class.serializationCode, @"button": @(_button) };
}
-+ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
- withMappings:(NSArray *)mappings {
++ (NJOutput *)outputWithSerialization:(NSDictionary *)serialization {
NJOutputMouseButton *output = [[NJOutputMouseButton alloc] init];
output.button = [serialization[@"button"] intValue];
return output;
CFRelease(click);
}
-- (int)humanIndexedButton {
- switch (_button) {
- case kCGMouseButtonLeft: return 0;
- case kCGMouseButtonCenter: return 1;
- case kCGMouseButtonRight: return 2;
- default: return 0;
- }
-}
-
-- (void)setHumanIndexedButton:(int)humanIndexedButton {
- switch (humanIndexedButton) {
- case 0: _button = kCGMouseButtonLeft; break;
- case 1: _button = kCGMouseButtonCenter; break;
- case 2: _button = kCGMouseButtonRight; break;
- default: _button = kCGMouseButtonLeft;
- }
-}
-
@end