-
Notifications
You must be signed in to change notification settings - Fork 71
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
Port keystroke delay. #358
Port keystroke delay. #358
Conversation
(This, if set to non-zero value, currently slows down all firmware scancode actions such as macros or caret mode. Atm., I consider it a feature...) |
I set the delay to 300. The first character appeared instantly, then rapidly typed characters afterward appeared with significant delay. The delay wasn't 300 ms, but more like a second, and shortly, some of the keys behaved as they got stuck. |
This is correct.
300ms is interval between report changes. Since every keystroke consists of two such changes (keydown and keyup) or more (extra modifier reports), the observed delay should be 600ms. Give or take 30% on inaccuracies of the firmware timer.
The postponer's queue is 32 events deep, which is 16 keystrokes. If it gets almost filled, it will usually start replaying keys one by one even if the postponing mode is kept active, except for the keystroke delay which is honored in all situations. So if you set this ridiculously long delay and overfill the buffer, then I guess loosing some of he events is an almost correct behaviour. Except that having keys stuck is not good -> fixed. |
The stuck keys issue got resolved, indeed, but
I'm unsure whether the above is considered normal, but they're not ideal. |
Standard "autorepeat" delay of most operating systems is 400ms. Which means that yeah - by definition the behaviour is correct. (And at 5ms resolution is a non-issue.)
This is again specific to the keystroke delay, not to the postponer. Since I never move cursor while writing heavily at the same time, I consider it a non issue. Of course the situation can be improved, but would probably need some refactors and would make the code more complex. |
I've been testing more in the meantime. Even a 10ms delay interferes with the caret mode substantially, as caret navigation becomes slower, and I often change lines in the IDE inadvertently. |
Sorry for the delay - this inquiry needed a bit testing and thinking on my part... unfortunately while testing the 10ms delay + caret mode, I have ran into strange problems (namely caret mode getting stuck) that so far withstanded all my debugging attempts. But to the point:
The keystroke delay inherently does slow down the caret navigation. That is known since by definition it is supposed to make firmware send at most one usb state change per the delay interval. After looking into the code, I am afraid I am not able to make an exception for the caret mode in a simple manner. Also, axis locking breaks due to the keystroke delay, since over the 10ms chunks of time, much larger deltas are fed into the algorithm - namely sufficiently large to override current lock. I can deal with this by resetting the module deltas over the delayed time. This is also likely to solve the problem which I mentioned in the beginning, but unfortunately without uncovering the root cause. The question is whether such solution is desired. |
@kareltucek Thanks for your PR and for addressing the pointer delta issue! |
…-model-version Fix factory mode version.
Closes #353.