hotkeys-js
hotkeys-js copied to clipboard
Is it possible to have hotkeys as sequence of same key (example: /+g+g)?
Hi there,
First of all, thank you for the amazing JS library.
As mentioned above, is it possible to have same key sequentially being pressed as the hotkey?
This would be something like pressing gg
inside a Github repository takes you to a Discussion tab.
Also, if we already have lets say /+g
as one of the hotkeys, can we have another hotkey as /+g+g
?
I tried below but it always picks up /+g
. I even changed the sequence of case
in the below code but still /+g
only gets triggered:
k('/+g,/+g+g', function (event, handler) {
event.preventDefault();
switch (handler.key) {
case '/+g':
// some code goes here..
break;
case '/+g+g':
// some code goes here for /+g+g..
break;
}
});
Any advice / suggestion would be of great help. Thanks.
I guess not :(