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

hs.eventtap.event.newSystemKeyEvent: keeps pressing the keys indefintely #3350

Closed
NightMachinery opened this issue Dec 26, 2022 · 1 comment

Comments

@NightMachinery
Copy link

I use this function to press system/media keys:

function systemKey(key, repeatDelay)
    -- REPEAT_FASTER = 10 * 1000
    REPEAT_FASTER = 5

    hs.eventtap.event.newSystemKeyEvent(key, true):post()

    if repeatDelay <= 0 then
        repeatDelay = REPEAT_FASTER
    end
    hs.timer.usleep(repeatDelay)
    hs.eventtap.event.newSystemKeyEvent(key, false):post()
end

However, using systemKey("NEXT") keeps going to the next file indefintely.

@NightMachinery
Copy link
Author

Restarting solved my 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

No branches or pull requests

1 participant