Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions to hs.mouse to get more information about cursor type #3628

Closed
germanartalejo opened this issue Apr 11, 2024 · 3 comments
Closed

Comments

@germanartalejo
Copy link

Hi, I was wondering if it could be possible to get the current cursor’s hotspot, image and image frame. If there’s already a way to get them I couldn’t find it.

Thanks in advance.

@dmgerman
Copy link

Look at extensions/mouse/libmouse.m

That is the low level mouse code. It looks like it might be easy to add new functionality. You could add the functions and test them.

See https://developer.apple.com/documentation/appkit/nscursor/1529096-hotspot?language=objc

@cmsj
Copy link
Member

cmsj commented Aug 5, 2024

I think, unfortunately, this isn't going to be possible safely - the required Apple API has been marked as Deprecated in the upcoming macOS 15: https://developer.apple.com/documentation/appkit/nscursor/1533611-currentsystemcursor?language=objc

@cmsj cmsj closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2024
@asmagill
Copy link
Member

asmagill commented Aug 5, 2024

FWIW, when I experimented with this in the past, it seemed to be limited to getting information and affecting the cursor only when Hammerspoon was active; when it wasn't, most of the information was nil or wrong (didn't change when the cursor did in other applications) so I never really dug into it further. IIRC there were some undocumented functions that gave some cursor info, but they stopped working ages ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants