diff options
author | Braden Wooley <bwooley@pdx.edu> | 2012-03-08 19:11:57 -0800 |
---|---|---|
committer | Braden Wooley <bwooley@pdx.edu> | 2012-03-08 19:11:57 -0800 |
commit | 6be0b03263b106706065fddd21be78f4059c615b (patch) | |
tree | 4145603c5fa08218592018581b16806daf985b59 /src/xtoq/XtoqController.m | |
parent | b8a7600e8626bcb9d6a0af2fdc803b02eb4d6fe6 (diff) |
changed mouse movement to be screen relative not window
Diffstat (limited to 'src/xtoq/XtoqController.m')
-rw-r--r-- | src/xtoq/XtoqController.m | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/xtoq/XtoqController.m b/src/xtoq/XtoqController.m index 3006e5f..1ab3a7f 100644 --- a/src/xtoq/XtoqController.m +++ b/src/xtoq/XtoqController.m @@ -32,6 +32,7 @@ #import "XtoqController.h" #define WINDOWBAR 22 +#define FILEBAR 23 @implementation XtoqController @@ -46,14 +47,14 @@ - (int) xserverToOSX:(int)yValue windowHeight:(int)windowH { int height = [[NSScreen mainScreen] frame].size.height; - return height - WINDOWBAR - windowH + yValue; + return height - windowH + yValue; } - (int) osxToXserver:(int)yValue windowHeight:(int)windowH { int height = [[NSScreen mainScreen] frame].size.height; - return height - yValue - WINDOWBAR; + return height - yValue; } @@ -215,8 +216,8 @@ //NSLog(@"Mouse Info: %@", [mouseDownInfo objectForKey: @"2"]); dispatch_async(xtoqDispatchQueue, ^{ dummy_xtoq_button_down (rootContext, - [event locationInWindow].x, - heightFloat - [event locationInWindow].y, + [NSEvent mouseLocation].x, + heightFloat - [NSEvent mouseLocation].y, (int)[event windowNumber], 0);;}); } @@ -233,10 +234,13 @@ heightAsNumber = [mouseDownInfo objectForKey: @"2"]; heightFloat = [heightAsNumber floatValue]; //NSLog(@"Mouse Info: %@", [mouseDownInfo objectForKey: @"2"]); + //NSLog(@"Mouse x = %i, y = %i", (int)[NSEvent mouseLocation].x, + // (int)[[NSScreen mainScreen] frame].size.height - FILEBAR - (int)[NSEvent mouseLocation].y); + dispatch_async(xtoqDispatchQueue, ^{ dummy_xtoq_mouse_motion (rootContext, - [event locationInWindow].x, - heightFloat - [event locationInWindow].y, + [NSEvent mouseLocation].x, + [[NSScreen mainScreen] frame].size.height - FILEBAR - [NSEvent mouseLocation].y, (int)[event windowNumber], 0);;}); } |