projects
/
enjoyable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
44fe6f6
)
Fix names while I still can.
author
Joe Wreschnig
<joe.wreschnig@gmail.com>
Thu, 28 Feb 2013 19:20:55 +0000
(20:20 +0100)
committer
Joe Wreschnig
<joe.wreschnig@gmail.com>
Thu, 28 Feb 2013 19:20:55 +0000
(20:20 +0100)
TargetController.m
patch
|
blob
|
history
TargetMouseBtn.h
patch
|
blob
|
history
TargetMouseBtn.m
patch
|
blob
|
history
TargetMouseMove.h
patch
|
blob
|
history
TargetMouseMove.m
patch
|
blob
|
history
TargetMouseScroll.h
patch
|
blob
|
history
TargetMouseScroll.m
patch
|
blob
|
history
diff --git
a/TargetController.m
b/TargetController.m
index
749feb2
..
08bf149
100644
(file)
--- a/
TargetController.m
+++ b/
TargetController.m
@@
-107,17
+107,17
@@
}
case 3: {
TargetMouseMove *mm = [[TargetMouseMove alloc] init];
}
case 3: {
TargetMouseMove *mm = [[TargetMouseMove alloc] init];
- mm.
dir
= mouseDirSelect.selectedSegment;
+ mm.
axis
= mouseDirSelect.selectedSegment;
return mm;
}
case 4: {
TargetMouseBtn *mb = [[TargetMouseBtn alloc] init];
return mm;
}
case 4: {
TargetMouseBtn *mb = [[TargetMouseBtn alloc] init];
- mb.
which
= mouseBtnSelect.selectedSegment == 0 ? kCGMouseButtonLeft : kCGMouseButtonRight;
+ mb.
button
= mouseBtnSelect.selectedSegment == 0 ? kCGMouseButtonLeft : kCGMouseButtonRight;
return mb;
}
case 5: {
TargetMouseScroll *ms = [[TargetMouseScroll alloc] init];
return mb;
}
case 5: {
TargetMouseScroll *ms = [[TargetMouseScroll alloc] init];
- ms.
howMuch
= scrollDirSelect.selectedSegment ? 1 : -1;
+ ms.
amount
= scrollDirSelect.selectedSegment ? 1 : -1;
return ms;
}
case 6: {
return ms;
}
case 6: {
@@
-180,15
+180,15
@@
}
else if ([target isKindOfClass:[TargetMouseMove class]]) {
[radioButtons setState:1 atRow:3 column:0];
}
else if ([target isKindOfClass:[TargetMouseMove class]]) {
[radioButtons setState:1 atRow:3 column:0];
- [mouseDirSelect setSelectedSegment:[(TargetMouseMove *)target
dir
]];
+ [mouseDirSelect setSelectedSegment:[(TargetMouseMove *)target
axis
]];
}
else if ([target isKindOfClass:[TargetMouseBtn class]]) {
[radioButtons setState:1 atRow:4 column:0];
}
else if ([target isKindOfClass:[TargetMouseBtn class]]) {
[radioButtons setState:1 atRow:4 column:0];
- mouseBtnSelect.selectedSegment = [(TargetMouseBtn *)target
which
] == kCGMouseButtonLeft ? 0 : 1;
+ mouseBtnSelect.selectedSegment = [(TargetMouseBtn *)target
button
] == kCGMouseButtonLeft ? 0 : 1;
}
else if ([target isKindOfClass:[TargetMouseScroll class]]) {
[radioButtons setState:1 atRow:5 column:0];
}
else if ([target isKindOfClass:[TargetMouseScroll class]]) {
[radioButtons setState:1 atRow:5 column:0];
- scrollDirSelect.selectedSegment = [(TargetMouseScroll *)target
howMuch
] > 0;
+ scrollDirSelect.selectedSegment = [(TargetMouseScroll *)target
amount
] > 0;
}
else if ([target isKindOfClass:[TargetToggleMouseScope class]]) {
[radioButtons setState:1 atRow:6 column:0];
}
else if ([target isKindOfClass:[TargetToggleMouseScope class]]) {
[radioButtons setState:1 atRow:6 column:0];
diff --git
a/TargetMouseBtn.h
b/TargetMouseBtn.h
index
a0b8516
..
e8d8013
100644
(file)
--- a/
TargetMouseBtn.h
+++ b/
TargetMouseBtn.h
@@
-10,6
+10,6
@@
@interface TargetMouseBtn : Target
@interface TargetMouseBtn : Target
-@property (assign) CGMouseButton
which
;
+@property (assign) CGMouseButton
button
;
@end
@end
diff --git
a/TargetMouseBtn.m
b/TargetMouseBtn.m
index
28fe536
..
2f56f7e
100644
(file)
--- a/
TargetMouseBtn.m
+++ b/
TargetMouseBtn.m
@@
-10,20
+10,20
@@
@implementation TargetMouseBtn
@implementation TargetMouseBtn
-@synthesize
which
;
+@synthesize
button
;
+ (NSString *)serializationCode {
return @"mbtn";
}
- (NSDictionary *)serialize {
+ (NSString *)serializationCode {
return @"mbtn";
}
- (NSDictionary *)serialize {
- return @{ @"type": @"mbtn", @"
which": @(self.which
) };
+ return @{ @"type": @"mbtn", @"
button": @(self.button
) };
}
+ (Target *)targetDeserialize:(NSDictionary *)serialization
withConfigs:(NSArray *)configs {
TargetMouseBtn *target = [[TargetMouseBtn alloc] init];
}
+ (Target *)targetDeserialize:(NSDictionary *)serialization
withConfigs:(NSArray *)configs {
TargetMouseBtn *target = [[TargetMouseBtn alloc] init];
- target.
which = [serialization[@"which
"] intValue];
+ target.
button = [serialization[@"button
"] intValue];
return target;
}
return target;
}
@@
-31,11
+31,11
@@
NSRect screenRect = [[NSScreen mainScreen] frame];
NSInteger height = screenRect.size.height;
NSPoint mouseLoc = [NSEvent mouseLocation];
NSRect screenRect = [[NSScreen mainScreen] frame];
NSInteger height = screenRect.size.height;
NSPoint mouseLoc = [NSEvent mouseLocation];
- CGEventType eventType = (
which
== kCGMouseButtonLeft) ? kCGEventLeftMouseDown : kCGEventRightMouseDown;
+ CGEventType eventType = (
button
== kCGMouseButtonLeft) ? kCGEventLeftMouseDown : kCGEventRightMouseDown;
CGEventRef click = CGEventCreateMouseEvent(NULL,
eventType,
CGPointMake(mouseLoc.x, height - mouseLoc.y),
CGEventRef click = CGEventCreateMouseEvent(NULL,
eventType,
CGPointMake(mouseLoc.x, height - mouseLoc.y),
-
which
);
+
button
);
CGEventPost(kCGHIDEventTap, click);
CFRelease(click);
}
CGEventPost(kCGHIDEventTap, click);
CFRelease(click);
}
@@
-44,11
+44,11
@@
NSRect screenRect = [[NSScreen mainScreen] frame];
NSInteger height = screenRect.size.height;
NSPoint mouseLoc = [NSEvent mouseLocation];
NSRect screenRect = [[NSScreen mainScreen] frame];
NSInteger height = screenRect.size.height;
NSPoint mouseLoc = [NSEvent mouseLocation];
- CGEventType eventType = (
which
== kCGMouseButtonLeft) ? kCGEventLeftMouseUp : kCGEventRightMouseUp;
+ CGEventType eventType = (
button
== kCGMouseButtonLeft) ? kCGEventLeftMouseUp : kCGEventRightMouseUp;
CGEventRef click = CGEventCreateMouseEvent(NULL,
eventType,
CGPointMake(mouseLoc.x, height - mouseLoc.y),
CGEventRef click = CGEventCreateMouseEvent(NULL,
eventType,
CGPointMake(mouseLoc.x, height - mouseLoc.y),
-
which
);
+
button
);
CGEventPost(kCGHIDEventTap, click);
CFRelease(click);
}
CGEventPost(kCGHIDEventTap, click);
CFRelease(click);
}
diff --git
a/TargetMouseMove.h
b/TargetMouseMove.h
index
24efa40
..
89f9c76
100644
(file)
--- a/
TargetMouseMove.h
+++ b/
TargetMouseMove.h
@@
-10,6
+10,6
@@
@interface TargetMouseMove : Target
@interface TargetMouseMove : Target
-@property (assign) int
dir
;
+@property (assign) int
axis
;
@end
@end
diff --git
a/TargetMouseMove.m
b/TargetMouseMove.m
index
f75f70b
..
893bbb6
100644
(file)
--- a/
TargetMouseMove.m
+++ b/
TargetMouseMove.m
@@
-18,20
+18,20
@@
return YES;
}
return YES;
}
-@synthesize
dir
;
+@synthesize
axis
;
+ (NSString *)serializationCode {
return @"mmove";
}
- (NSDictionary *)serialize {
+ (NSString *)serializationCode {
return @"mmove";
}
- (NSDictionary *)serialize {
- return @{ @"type": @"mmove", @"
dir": @(self.dir
) };
+ return @{ @"type": @"mmove", @"
axis": @(self.axis
) };
}
+ (Target *)targetDeserialize:(NSDictionary *)serialization
withConfigs:(NSArray *)configs {
TargetMouseMove *target = [[TargetMouseMove alloc] init];
}
+ (Target *)targetDeserialize:(NSDictionary *)serialization
withConfigs:(NSArray *)configs {
TargetMouseMove *target = [[TargetMouseMove alloc] init];
- target.
dir = [serialization[@"dir
"] intValue];
+ target.
axis = [serialization[@"axis
"] intValue];
return target;
}
return target;
}
@@
-57,7
+57,7
@@
if ([jc frontWindowOnly])
speed = 12.f;
float dx = 0.f, dy = 0.f;
if ([jc frontWindowOnly])
speed = 12.f;
float dx = 0.f, dy = 0.f;
- if (
self.dir
== 0)
+ if (
axis
== 0)
dx = self.magnitude * speed;
else
dy = self.magnitude * speed;
dx = self.magnitude * speed;
else
dy = self.magnitude * speed;
diff --git
a/TargetMouseScroll.h
b/TargetMouseScroll.h
index
cdfe010
..
5c13d5f
100644
(file)
--- a/
TargetMouseScroll.h
+++ b/
TargetMouseScroll.h
@@
-10,6
+10,6
@@
@interface TargetMouseScroll : Target
@interface TargetMouseScroll : Target
-@property (assign) int
howMuch
;
+@property (assign) int
amount
;
@end
@end
diff --git
a/TargetMouseScroll.m
b/TargetMouseScroll.m
index
3c417c1
..
4d6f409
100644
(file)
--- a/
TargetMouseScroll.m
+++ b/
TargetMouseScroll.m
@@
-10,27
+10,27
@@
@implementation TargetMouseScroll
@implementation TargetMouseScroll
-@synthesize
howMuch
;
+@synthesize
amount
;
+ (NSString *)serializationCode {
return @"mscroll";
}
- (NSDictionary *)serialize {
+ (NSString *)serializationCode {
return @"mscroll";
}
- (NSDictionary *)serialize {
- return @{ @"type": @"mscroll", @"
howMuch": @(self.howMuch
) };
+ return @{ @"type": @"mscroll", @"
amount": @(self.amount
) };
}
+ (Target *)targetDeserialize:(NSDictionary *)serialization
withConfigs:(NSArray *)configs {
TargetMouseScroll *target = [[TargetMouseScroll alloc] init];
}
+ (Target *)targetDeserialize:(NSDictionary *)serialization
withConfigs:(NSArray *)configs {
TargetMouseScroll *target = [[TargetMouseScroll alloc] init];
- target.
howMuch = [serialization[@"howMuch
"] intValue];
+ target.
amount = [serialization[@"amount
"] intValue];
return target;
}
-(void) trigger {
CGEventRef scroll = CGEventCreateScrollWheelEvent(NULL,
kCGScrollEventUnitLine,
1,
return target;
}
-(void) trigger {
CGEventRef scroll = CGEventCreateScrollWheelEvent(NULL,
kCGScrollEventUnitLine,
1,
- self.
howMuch
);
+ self.
amount
);
CGEventPost(kCGHIDEventTap, scroll);
CFRelease(scroll);
}
CGEventPost(kCGHIDEventTap, scroll);
CFRelease(scroll);
}