-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Exit insert mode on key hold #1494
Comments
Cool but due to the limitation of the terminal, I don't think this is even possible... |
Sure thing, maybe this could only work in a proper GUI whenever Helix gets one, though why not? Helix is able to see char |
Terminal I think it is possible, but it might be incorrect, it depends on the user settings on key repeat, if user key does not repeat then can't detect, but if user key repeat at very slow pace then the timing may be off, this is best implemented on GUI. Closing this for now since it's GUI related, can reopen when we have GUI later. Or if you think otherwise can still reopen. |
ok, let's call it "on repeat" instead of "on hold", then it will be correct — if a user changed his keyboard behavior not to repeat, then he simply won't be able to use the "on repeat" functionality as he has no repeat :)
Unless you read it from a config and let the user set whatever value he likes? Even in the future GUI the timing should be configurable as there is no value that fits everyone due to individual typing preferences |
We can't do anything about user setting the speed and even if user provide a value in config we can't set the user typematic speed as well so not really a useful method. But GUI on the other hand, we get know how long a user hold unlike in the terminal, which the keys will repeat at a constant pace, the other issue is that some of the user set the initial delay to a high amount, so it will take very long for the key to start repeat and we don't know if the user did repeat the key or did not. |
You don't need to set anything — let the user pass the values that work with whatever his system typing configs / typematic speed etc. are. Similarly
Then the user will just enter a very long timeout to fit his very long repeat start You are basically asking a user for 3 values in his Helix config:
Then if you get
If a user has system settings of 1 second delay before repeat and a repeat rate of 1 per second, this will work (he'll send 3 keys per 2 seconds) |
One issue I see is we probably don't want user to add 3 config to get this working. I myself won't find this useful, but if you are interested to work on it (since I doubt others find this useful), feel free to give this a try and submit a pull request, then I can help you look into it. archseer suggested https://docs.qmk.fm/#/tap_hold, maybe you can look into that. |
I think this type of stuff is best addressed in keyboard firmware where you can have full control over the keys (i.e. https://docs.qmk.fm/#/tap_hold). The behavior will vary depending on the terminal emulator, and it becomes problematic if I intend to type |
But the firmware doesn't know what mode Helix is in! Firmware might not even know what application is running (also, way too many keyboards don't have it, so it'd a very limited solution)
nope, you just pass the input through and then clean it up I similar software-based text input functions like showing a symbol selection picker when you hold a button in a text editor and I don't introduce input delay, the first key press always types a letter right away!, but rather add a simple cleaning-an-extra-symbol routine (it's just one symbol since I can block further repeats), it's just fine (granted, Helix can't block further repeats, but it can still easily clean everything up — it knows how many That's why Helix is unforunately the only place to add such a bomb of a feature (mode switching is frequent enough to need the easy way to do it), and it would work just fine even in a terminal without a GUI
That strikes me more like just bad defaults, the users wishing to have such compex conflicting keybinds should suffer and tweak the delays to whatever suits them, not everyone! |
Why not? The timing challenges are real, they are user hardware/software/preference specific, so user is the only person able to provide such information
As I mentioned above, firmware lacks the software knowledge to implement this
Yeah, that might be a challenge, I don't know any Rust and only implemented such a solution in AutoHokey, and your Meanwhile, could you please reopen the issue as it's not really GUI-dependent? Also might help someone else see it and appreciate the beauty of this mode-switching-without-leaving-home-row solution enough to help with the implementation :) |
The complexity is not related to the language of the project but due to the limitation of the terminal. Please do try it out and prove me wrong, I put
Yes, it is not GUI-dependent, but it is not suitable for terminal either due to terminal limitations. Since it is not that relevant, I think it is better to leave it close (open issue does not mean anyone is working on it either), if anyone is interested to take up the issue can post here and I assign the issue then submit the pull request, in the meantime I think this should remain closed. |
Of course it is, the AutoHotkey solution is two simple functions
And it already works in Helix in a terminal, but then of course it messes up the normal mode since AutoHotkey doesn't know the difference, so holding the key fires it up regardless of the mode, and I'd have to lose the whole key (make it Would that be of comparable simplicity within this project?
Which one? The limitations you raised above were about the inability to guess the timings a user might want, which is fine, let the user give the needed timing in a config
but it does mean it's more visible, so this
has a higher chance of happening |
Yes, but AutoHotkey is a framework specifically built for these types of keybinds.
https://who-t.blogspot.com/2016/04/why-libinput-doesnt-have-lot-of-config.html |
That's precisely why this "The complexity is not related to the language of the project" is false! The point of the second quote eludes me, where was I saying that it'd be "just 5 lines of code" in Helix??? But are you now implying that you wouldn't want to have "on repeat" functionality in Helix at all even if someone else implemented it because it doesn't "pay off long-term"? |
@eugenesvk let it go. This is approaching harassment. Unless you are going to be the person doing the work to implement this feature, and then maintaining its functionality for the foreseeable future, you really don't get an opinion on whether it's worth it or not. |
please quote me where I've expressed one |
Given the high frequency of exiting various modes it makes sense to find the easiest keybind way possible to switch back
Helix has a helpful suggestion:
However, the first requires a modifier and the second introduces a typing delay (
j
isn't shown after j is pressed until the next key is pressed)(likewise, binding Esc to Caps is a pinky move, so not that great either)
I think an even better alternative would be to get rid of a useless letter repetition (if only for a single letter) to have an "on hold"
normal_mode
command so that you could hold an extremely convenient home row key, e.g., a for 0.5 seconds and that would switch back to normal mode (and, importantly, not execute any normal mode commands bound to a until it's released) instead of typingaaa
(you might also need to delay the first
a
character before exiting after an "on hold" event to avoid typing delays and also avoid extraneousa
)The text was updated successfully, but these errors were encountered: