}
- (NSDictionary *)serialize {
- return @{ @"type": @"key press", @"key": @(_vk) };
+ return _vk != NJKeyInputFieldEmpty
+ ? @{ @"type": self.class.serializationCode, @"key": @(_vk) }
+ : nil;
}
+ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
- (NSDictionary *)serialize {
return _mapping
- ? @{ @"type": @"mapping", @"name": _mapping.name }
+ ? @{ @"type": self.class.serializationCode, @"name": _mapping.name }
: nil;
}
}
- (NSDictionary *)serialize {
- return @{ @"type": @"mouse button", @"button": @(_button) };
+ return @{ @"type": self.class.serializationCode, @"button": @(_button) };
}
+ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
}
- (NSDictionary *)serialize {
- return @{ @"type": @"mouse move", @"axis": @(_axis) };
+ return @{ @"type": self.class.serializationCode, @"axis": @(_axis) };
}
+ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
}
- (NSDictionary *)serialize {
- return @{ @"type": @"mouse scroll", @"amount": @(_amount) };
+ return @{ @"type": self.class.serializationCode, @"amount": @(_amount) };
}
+ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
}
- (NSDictionary *)serialize {
- return @{ @"type": @"switch mouse mode" };
+ return @{ @"type": self.class.serializationCode };
}
+ (NJOutput *)outputDeserialize:(NSDictionary *)serialization