0

I've seen this question asked multiple times here, and I tried some answers, but it doesn't seem to work for me.

NSPoint pnt = [[self window] convertScreenToBase:[NSEvent mouseLocation]];

I'm using above code to do my conversion, but I get same coordinates for pnt.x and pnt.y no matter where mouse location is.

I noticed that this method is deprecated, but it should still work I guess, right?

Does anyone have any good suggestion on how I can do this conversion?

Any kind of help is highly appreciated!

4

1 回答 1

3

你应该[window mouseLocationOutsideOfEventStream]改用。

于 2014-08-15T09:46:32.580 回答