mousetrap
mousetrap copied to clipboard
Typing 25 acts like if you've typed 2
Hi.
I have a gallery. Every photo in the gallery have unique numbers. If I type 25, I want to go to photo 25. But instead, it goes to photo 2.
Suggestion: wait for maybe 1 second (or less) for the function to take action.
Already works if in bind you put "2 5" ie with a space in between.
Thanks. That works. But if I have a shortcut that have 2
and also 2 0
, only the last one will be registered. However, I can use 0 2
and that will work.
It is written in the documentation that you cannot have a single key also as start key of a sequence. Unfortunately seems you have to develop your own input method. Something along the lines of: handler for keypress, start a timer, if another keypress happens before timer expires then append to input string. In my opinion Mousetrap is not the right tool to solve your problem. Good luck! mario