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 programmatically create a hotkey from the key the user has pressed? #360

Open
msimic opened this issue Apr 27, 2022 · 1 comment
Open

Comments

@msimic
Copy link

msimic commented Apr 27, 2022

I would like to offer the user a dialog to press a combination of keys and remember them as a hotkey shortcut for future use.

What I am looking for is something like this:

var pressedCodes = hotkeys.getPressedKeyCodes()
var newHotkey = convertCodesToHotkeyDefinition(pressedCodes)

hotkeys(newHotkey, function(){
  // user used the shortcut he created
})

Obviously, I don't know how to generate the hotkey from the array of pressed codes (my convertCodesToHotkeyDefinition).
Is there a function in hotkeys-js to do that or somebody knows how to do it?

Regards

@msimic
Copy link
Author

msimic commented Jun 24, 2022

No news here? Without this, the library is limited to only static shortcuts.
No way to give the user the ability to assign their own shortcuts... (and no, having him fill a textbox with the string for the shortcut is not an option - not user friendly).

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