projects
/
enjoyable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Big rename part 2: 'config' etc. to 'mapping.
[enjoyable.git]
/
TargetMouseBtn.m
diff --git
a/TargetMouseBtn.m
b/TargetMouseBtn.m
index
3efb88a
..
a19b484
100644
(file)
--- a/
TargetMouseBtn.m
+++ b/
TargetMouseBtn.m
@@
-3,7
+3,6
@@
// Enjoy
//
// Created by Yifeng Huang on 7/27/12.
// Enjoy
//
// Created by Yifeng Huang on 7/27/12.
-// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import "TargetMouseBtn.h"
//
#import "TargetMouseBtn.h"
@@
-19,16
+18,15
@@
}
+ (Target *)targetDeserialize:(NSDictionary *)serialization
}
+ (Target *)targetDeserialize:(NSDictionary *)serialization
- with
Configs:(NSArray *)confi
gs {
+ with
Mappings:(NSArray *)mappin
gs {
TargetMouseBtn *target = [[TargetMouseBtn alloc] init];
target.button = [serialization[@"button"] intValue];
return target;
}
-(void) trigger {
TargetMouseBtn *target = [[TargetMouseBtn alloc] init];
target.button = [serialization[@"button"] intValue];
return target;
}
-(void) trigger {
- NSRect screenRect = [[NSScreen mainScreen] frame];
- NSInteger height = screenRect.size.height;
- NSPoint mouseLoc = [NSEvent mouseLocation];
+ CGFloat height = NSScreen.mainScreen.frame.size.height;
+ NSPoint mouseLoc = NSEvent.mouseLocation;
CGEventType eventType = (_button == kCGMouseButtonLeft) ? kCGEventLeftMouseDown : kCGEventRightMouseDown;
CGEventRef click = CGEventCreateMouseEvent(NULL,
eventType,
CGEventType eventType = (_button == kCGMouseButtonLeft) ? kCGEventLeftMouseDown : kCGEventRightMouseDown;
CGEventRef click = CGEventCreateMouseEvent(NULL,
eventType,
@@
-39,9
+37,8
@@
}
-(void) untrigger {
}
-(void) untrigger {
- NSRect screenRect = [[NSScreen mainScreen] frame];
- NSInteger height = screenRect.size.height;
- NSPoint mouseLoc = [NSEvent mouseLocation];
+ CGFloat height = NSScreen.mainScreen.frame.size.height;
+ NSPoint mouseLoc = NSEvent.mouseLocation;
CGEventType eventType = (_button == kCGMouseButtonLeft) ? kCGEventLeftMouseUp : kCGEventRightMouseUp;
CGEventRef click = CGEventCreateMouseEvent(NULL,
eventType,
CGEventType eventType = (_button == kCGMouseButtonLeft) ? kCGEventLeftMouseUp : kCGEventRightMouseUp;
CGEventRef click = CGEventCreateMouseEvent(NULL,
eventType,