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

hotkey.ctrl is not detecting pressed ctrl key correctly #476

Open
semrola opened this issue Feb 9, 2024 · 1 comment
Open

hotkey.ctrl is not detecting pressed ctrl key correctly #476

semrola opened this issue Feb 9, 2024 · 1 comment

Comments

@semrola
Copy link

semrola commented Feb 9, 2024

For example we have this snippet of code:

hotkeys('ctrl+i', function(event) {
    event.preventDefault();
    alert('This is ctrl+i');
})

hotkeys('shift+k', function(event) {
    event.preventDefault();
    let ctrl = hotkeys.ctrl;
    alert('Is ctrl pressed: ' +  ctrl);
})

If we execute ctrl+i first and then shift+k, the second alert will indicate that ctrl is pressed even though it is not.
Tested with version 3.13.7.

@semrola
Copy link
Author

semrola commented Feb 12, 2024

Found out that hotkeys.isPressed('ctrl') is working correctly.

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