I can't seem able to get a useful mouse location from NSEvent. I rigged a mouseDown event method to log the mouse coordinates. The method is evoked as expected but the location displayed is unintelligible.
The x coordinate is always zero, and the y is a large integer. Mouse movement on x axis changes the "y" number, and y-axis movement has no effect. Also, the "y" number isn't random, in fact it is linear, but one pixel of mouse movement is a few thousand in change.
I can't seem to make any sense of this at all. Does anyone have any ideas?
Code:
NSPoint location=[NSEvent mouseLocation];
NSLog(@"{ %d, %d }", location.x, location.y);
The x coordinate is always zero, and the y is a large integer. Mouse movement on x axis changes the "y" number, and y-axis movement has no effect. Also, the "y" number isn't random, in fact it is linear, but one pixel of mouse movement is a few thousand in change.
I can't seem to make any sense of this at all. Does anyone have any ideas?