-
Notifications
You must be signed in to change notification settings - Fork 186
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
Feature request: Oneshot() with timeout #277
Comments
I have also thought about this, for the same use case. Its absence hasn't caused me so much grief (yet) to have done a feature request but needless to say I do like the idea.
What about not changing the name at all and just have an optional argument? |
That's actually another thing I wanted to propose: Remove all 2-versions of existing actions and instead allow optional arguments. This would require slightly more involved parsing logic which would be more than set off by a much cleaner end user experience. The 2-versions could be declared as deprecated and accepted as well for a while. |
How about something like You could then implement a decaying
It could potentially have other uses like the time based sequence logic described here.
Optional arguments were implemented at one point before they were abandoned in favour of the current syntax. Aside from making parsing a bit easier, it also provides a visual way to identify more involved actions (since it isn't immediately obvious what the extraneous arguments do) and makes it easier to search the man page. It's also worth noting that some actions (e.g |
Even better, of course. Should have been my first thought. Nicely symmetrical. I do think the |
|
One more remark: For consistency, as one can already define defaults for |
Agreed. The hard part is coming up with a good name.
Something like
I have no objection to doing this if it improves readability. The old names can be kept for backwards compatibility.
I think this adds a bit too much complexity. Most users won't bother with timeouts, and those that do should probably understand precisely how the timeouts are applied. Forcing them to be as explicit as possible is a good thing. |
While
On second thought I agree with you. |
If anything, the 'tap-timeout', to me, makes more sense. A timeout feels like something that happens unless something else happens, whereas a 'hold-timeout' (or 'timer') requires the user to continue pressing (...but I realize you can also interpret that as 'nothing else happening'). In any case, how else is the user supposed to interpret a timeout on a tap? But intuitions differ, of course. And I'm not a native speaker, so what do I know :)
Ah,
Wait, what would that look like? |
How about |
Another proposal (inspired by the leading spreadsheet software I detest but am forced to use at work regularly):
where EDIT: corrected my confusion with interruption |
I really like
|
I'm now also in favour of @slakkenhuis I think my use case (homerow modifiers) is sane and I'm vouching for full control of the way interrupting key presses or taps are handled during the timeout window. This could also be of interest for you, as it would solve at least some of the issues you had in #81. Any support in my attempts to persuade @rvaiya in #278 would be greatly appreciated... |
Sure, I'll think when I get some time. Be warned that my involvement may backfire, as rvaiya's relative conservatism on this matter has proved pretty persuasive to me :P Anyway, apart from these syntax concerns, that issue can be considered wholly separately from this one, right? |
Thank you!
I'm actually very thankful for this conservatism and don't even want to imagine what ugly beast keyd would have become if all my feature requests had been blindly implemented. Thinking things through is part of my job, but keyd (and warpd) get me so excited that I regularly throw all good principles over board. The question is, if that's good or bad... At least I have the excuse of not having a cs background.
Yes. |
The problem with the name is that it doesn't necessarily have anything to do with whether or not the key is tapped. The sequences In some ways a neutral name like
Case in point :P.
I assume this is the new name for
In which case I believe
Can you explain the rationale?
+1.
You needn't be so hard on yourself. Taste is subjective after all ;). My opinions are just that. While some of these names might be improvements, none of them indicate what the action does in isolation. The user would still have to have read the man page to properly disambiguate them from other possible interpretations. Given that this is the case, I am still inclined to think more neutral names (like |
I agree,
I disagree there: while I might have to read the man page once to understand what If there was an actively counterintuitive interpretation for the suffixes, I'd be more inclined to agree, but while that might have been the case for
While the user could surely strain themselves to find a different interpretation, I can't think of any that are obvious. And |
This should be
This should actually be the substitute of the current Regarding
and
I agree to both of @slakkenhuis's points. Good notation would be self-explanatory for existing users. Optimal notation is self-explanatory for (most) new users, at least those with some experience in the world of programmable keyboards. One of the strong points of keyd is its simple configuration file format, and I think that it's possible to reach the point where new users reading some configuration example somewhere immediately understand what's going on.
Exactly. But to repeat,: As |
While I haven't formed feelings on #278 yet (asap!) I do strongly feel that the current timeout behaviour should be the default for holding, as it is the one that most users want --- or at least should be steered towards. Even if other hold behaviours might make sense depending on your level of comfort with the dark arts, interruptable timeouts as they are now are the only ones that can make for a natural typing experience even without conscious fine-tuning and maniacal cackling on the part of the user. (By the way, it just occurred to me that both timeouts can also be combined: |
While it might be true that most users actually want the current timeout mechanism, I see no objective reason to steer them towards a specific interrupt behaviour. It depends a lot on the actual use case, and overloading a modifier key like shift is very different from overloading a letter key.
Well, here I again think that many people would disagree with you. But even assuming that interruptable timeouts should be preferred, why should choosing the first action on interrupt be more natural than choosing the second action? A slowly typing person, only creating isolated keypresses without any rolls, might actually find it more natural that something like
Combining the current However, as @rvaiya wrote, let's continue the discussion about |
After some additional thought I decided to add a global |
I'd like to propose an expiration mechanism for oneshot, say
oneshot2(layer, timeout)
for the sake of discussion, which behaves like oneshot but only if the next key is pressed withintimeout
ms. The naming is suboptimal, as the two at the end usually signals the ability to supply a macro to be executed (and who knows if at some point a use case warranting the introduction ofoneshot2(layer, macro)
will be found), but I couldn't come up with something better except the more cumbersomelayer_timeout
.Repeated calls to
oneshot2()
with the same layer argument should reset the timer to the last suppliedtimeout
, while any other action activating or deactivating a layer with a currently attached timer should remove this timer. Also, from an implementation perspective, it is probably a good idea to only allow a single expiring layer at a time, i.e. callingoneshot2()
while a layer different from the one given as argument has an active timer would deactivate this other layer.This would address the following use cases:
The
oneshot2()
action would allow a user to change his mind after pressing the corresponding key. Currently, “cancelling” a oneshot action without visible consequences necessitates an additional keypress (typically some modifier key).More concretely, I would like to toggle some layer by tapping shift twice, i.e.
After testing it for a while, I temporarily removed this functionality as it often happened that I tapped shift because I wanted to start some sentence and then changed my mind. When I then wanted to continue to type and hence pressed shift again, layerA would activate, which was a bit annoying. If
oneshot(shift)
could be replaced withoneshot2(shift, 500)
, this problem would not occur.Usually, after moving the mouse one has to click somewhere. If keyd would be able to activate an expiring navigation layer (typically with the mouse buttons on the home row) while moving a trackpoint or external mouse, one could replace the physical mouse buttons by proper keyboard buttons without the need to use some additional modifier press or explicitly activating a layer.
Of course, for this functionality one would need to enable calling actions via IPC in addition (which is planned to be implemented if I'm not mistaken), so that some script could monitor for mouse move uevents and issue the corresponding
oneshot2()
call.The text was updated successfully, but these errors were encountered: