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

How to construct a Smart magnify eventtap.event #3282

Open
jannis-baum opened this issue Aug 26, 2022 · 1 comment · May be fixed by #3679
Open

How to construct a Smart magnify eventtap.event #3282

jannis-baum opened this issue Aug 26, 2022 · 1 comment · May be fixed by #3679

Comments

@jannis-baum
Copy link

I can't seem to figure out how to construct a Smart magnify event any way other than capturing a "real" one, using hs.eventtap.event:asData() to get its data and constructing a new one from the data with hs.eventtap.event.newEventFromData.

I've tried

  • creating a newEvent, setting its type, location (& timestamp) and posting it, which does nothing
  • creating a newMouseEvent, which throws an error since it doesn't recognize the Smart magnify type
  • creating a newGesture, which also doesn't recognize it

The way I have it now is keeping the base64 encoded data from a captured event hardcoded in my config, using hs.eventtap.event.newEventFromData to construct a working event, modifying its location and then posting it. This does work but of course is far from optimal.

Is there anything I am missing or is it not supported to construct Smart magnify events?

@latenitefilms
Copy link
Contributor

Ummm... I think "smart magnify" would probably need to be added to hs.eventtap.event.newGesture, as it currently only supports magnify.

@asmagill might have a better explanation?

For future reference, this is how I trigger new gestures:

https://github.com/CommandPost/CommandPost/blob/develop/src/plugins/core/gestures/init.lua

kriomant added a commit to kriomant/hammerspoon that referenced this issue Aug 24, 2024
@kriomant kriomant linked a pull request Aug 24, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants