moolmanruan / obsidian-sequence-hotkeys

Obsidian plugin to support a sequenced of keyboard shortcuts to run commands.
GNU General Public License v3.0
38 stars 3 forks source link

FR: add time limit on the plugin. #10

Closed YIRU69 closed 2 years ago

YIRU69 commented 2 years ago

Hello friend. I have a good idea to improve the plugin when I get up early. Could you try to add a time limit when input sequence hotkeys? For example, when I input an interval greater than 1s, I ignore the hotkey I entered earlier. This will avoid some unnecessary errors.

nhan000 commented 2 years ago

I need this too. Please consider implementing it like how Doubleshift plugin does.

moolmanruan commented 2 years ago

Hi @YIRU69 and @nhan000. Sorry for the slow reply, was a bit busy recently. I'll think about it a bit.

One solution could be to not consume presses if they don't match an ongoing sequence. For example ctrl-w ctrl-q is mapped to a command. If you press ctrl-w it is consumed and the plugin waits for the next press. Currently if something other than ctrl-q is pressed that press is captured and the sequence reset, but instead I could let the next press through normally (if it's not ctrl-q) and reset the sequence.

moolmanruan commented 2 years ago

Made the change. Let me know if it solves your problems.

YIRU69 commented 2 years ago

@moolmanruan Hi, I am glad to watch you improve it. It is great way to solve my problem!

lukemt commented 1 year ago

It works just beautifully!