Is there a way to know what the current system cursor on mac/ OSX is ? I know we can get current cursor using [NSCursor currentSystemCursor]
call. But this does not tell us what the current cursor is. The check
if ([[NSCursor currentSystemCursor] isEqual:[NSCursor arrowCursor]])
always fails. Even the check if ([[NSCursor currentSystemCursor] isEqual:[NSCursor currentSystemCursor]])
always returns zero.
I have gone through similar question How to get current type of mouse cursor in Mac OS X? but did not find any way of doing it there.
Any help on this is appreciated. Thanks in advance.
Unfortunately not.
What you can do is get the cursor image and the compare that image to the image of a known cursor (arrow, I-beam, etc).
However many apps supply slight variations of each cursor so your check can never be exhaustive unless you keep updating the app to know about more and more cursor variation.
You can even build an algorithm to analyse the cursor image to heuristically categorise it.
It sounds hacky, I know. But it does work. Kinda.