diff options
author | Teddy Wing | 2016-11-16 04:51:45 -0500 |
---|---|---|
committer | Teddy Wing | 2016-11-16 04:51:45 -0500 |
commit | b3e644a6ec9d14554f4268d38b543cc1d8b7197e (patch) | |
tree | 417ab1c4c9799393147c759761d5019f94bbbe4b | |
parent | 3db243f3c84f7ab36747f4badfd4f57a26563821 (diff) | |
download | Low-Battery-Yup-b3e644a6ec9d14554f4268d38b543cc1d8b7197e.tar.bz2 |
Mouse: Change mouse coordinates to Low Battery OK button
Modify the coordinates such that instead of clicking the center of the
screen, we click the OK button on the low battery warning dialog.
Rename the method according to its new intent.
TODO: This probably doesn't work on other displays that have different
resolutions. We need to check that and figure out a cross-display
solution.
-rw-r--r-- | Low Battery Yup d/AppDelegate.m | 2 | ||||
-rw-r--r-- | Low Battery Yup d/Mouse.h | 2 | ||||
-rw-r--r-- | Low Battery Yup d/Mouse.m | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/Low Battery Yup d/AppDelegate.m b/Low Battery Yup d/AppDelegate.m index 8c31526..4914883 100644 --- a/Low Battery Yup d/AppDelegate.m +++ b/Low Battery Yup d/AppDelegate.m @@ -19,7 +19,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { Mouse *m = [[Mouse alloc] init]; - [m moveToCenter]; + [m moveToLowBatteryOK]; [m click]; } diff --git a/Low Battery Yup d/Mouse.h b/Low Battery Yup d/Mouse.h index 0671083..e15a212 100644 --- a/Low Battery Yup d/Mouse.h +++ b/Low Battery Yup d/Mouse.h @@ -14,7 +14,7 @@ } - (void)moveToPoint:(CGPoint)point; -- (void)moveToCenter; +- (void)moveToLowBatteryOK; - (void)click; @end diff --git a/Low Battery Yup d/Mouse.m b/Low Battery Yup d/Mouse.m index 137b560..9bade59 100644 --- a/Low Battery Yup d/Mouse.m +++ b/Low Battery Yup d/Mouse.m @@ -26,15 +26,15 @@ CGDisplayMoveCursorToPoint(_current_display, point); } -- (void)moveToCenter +- (void)moveToLowBatteryOK { CGPoint point; size_t width = CGDisplayPixelsWide(_current_display); size_t height = CGDisplayPixelsHigh(_current_display); - point.x = width / 2; - point.y = height / 2; + point.x = width / 2 + 182; + point.y = height / 2 - 116; [self moveToPoint:point]; } |