forked from fyhuang/enjoy2
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTarget.m
54 lines (44 loc) · 1.38 KB
/
Target.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// Target.m
// Enjoy
//
// Created by Sam McCall on 5/05/09.
//
@implementation Target
+(Target*) unstringify: (NSString*) str withConfigList: (NSArray*) configs {
NSArray* components = [str componentsSeparatedByString:@"~"];
NSParameterAssert([components count]);
NSString* typeTag = [components objectAtIndex:0];
if([typeTag isEqualToString:@"key"])
return [TargetKeyboard unstringifyImpl:components];
if([typeTag isEqualToString:@"cfg"])
return [TargetConfig unstringifyImpl:components withConfigList:configs];
if([typeTag isEqualToString:@"mmove"])
return [TargetMouseMove unstringifyImpl:components];
if([typeTag isEqualToString:@"mbtn"])
return [TargetMouseBtn unstringifyImpl:components];
if([typeTag isEqualToString:@"mscroll"])
return [TargetMouseScroll unstringifyImpl:components];
if([typeTag isEqualToString:@"mtoggle"])
return [TargetToggleMouseScope unstringifyImpl:components];
NSParameterAssert(NO);
return NULL;
}
-(NSString*) stringify {
[self doesNotRecognizeSelector:_cmd];
return NULL;
}
-(void) trigger: (JoystickController *)jc {
[self doesNotRecognizeSelector:_cmd];
}
-(void) untrigger: (JoystickController *)jc {
// no-op by default
}
-(void) update: (JoystickController *) jc {
[self doesNotRecognizeSelector:_cmd];
}
-(BOOL) isContinuous {
return false;
}
@synthesize inputValue, running;
@end