-
-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Insert delay between shifted chars in send_string_with_delay #19280
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this should be done. send_char
is meant to send a single character (not key event) in one operation - ideally a single report, but I don't know if this is what actually happens. The obvious workaround is to simply increase TAP_CODE_DELAY
in your config.h.
8001771
to
526658f
Compare
526658f
to
c3f1e93
Compare
c3f1e93
to
81b1fd9
Compare
I tried to think of a way we could get the |
quantum/send_string/send_string.c
Outdated
} | ||
|
||
tap_code(keycode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fauxpark Would tap_code_delay
be better here?
tap_code(keycode); | |
tap_code_delay(keycode, interval); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that makes a lot of sense; done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that controls the time between keydown and keyup of the keycode, not the time between keyup of the previous event and keydown of the next.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I was thinking it would make sense to use a consistent delay for every key event. Even without using the same delay for tapping, the input delay is what was used between key down for the mods and the ASCII character. If we want to distinguish, then should we use TAP_CODE_DELAY
between key down on mods and the ASCII character, then the input delay after key ups? This seems like it could get confusing for users trying to figure out the right timing for SEND_STRING_DELAY
.
In my opinion, it makes more sense to use a consistent delay for every key event. But I'll defer to your judgement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, it makes more sense to use a consistent delay for every key event.
This would be my expectation too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we should rename TAP_CODE_DELAY
to more effectively communicate this. Right now it kind of implies that it's the delay between keydown and keyup when you call tap_code()
, because it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we should rename
TAP_CODE_DELAY
to more effectively communicate this. Right now it kind of implies that it's the delay between keydown and keyup when you calltap_code()
, because it is.
I mean I'm not too fussed about just using the tap code delay either way, so if this is a point of contention, I'm perfectly happy to just continue with previous semantics.
But with that said, I'm having trouble understanding what you're saying. In my view, TAP_CODE_DELAY
is "delay between keydown and keyup when you call tap_code()
", as you say. But the delay at issue here is the one in use in SEND_STRING_DELAY
, and is, from my perspective, independent of tap_code()
. The fact that it calls tap_code()
internally is just an implementation detail. So to rename a long-standing configuration parameter because of its use as the default in an unrelated function seems puzzling to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But with that said, I'm having trouble understanding what you're saying.
You're suggesting we use TAP_CODE_DELAY
as the default value for every delay that sendstring does, which includes the ones you're introducing, between the key events. Not just in the tap_code()
. To me this muddies the meaning of the define's name, so if we want this value to be applied to more than just tap_code()
, it should probably be renamed to be more generic. I'm not saying that should be done in this PR, just noting a potential point of confusion for users.
81b1fd9
to
0957c73
Compare
Another thought occurred to me: would it make sense to make the default wait time for Edit: in fact, I think we may have to if we want to use the same interval as the input for the ASCII character's tap delay. If we don't default to |
d7efd44
to
0f3e238
Compare
0957c73
to
0e1416f
Compare
Wait, I'm confused, I thought |
0f3e238
to
7026db7
Compare
Curiously, rebased on top of the latest
which doesn't look like it has anything to do with my change. Is there anything else blocking this PR? Are we just waiting for another review? |
Bumping this again. Are there any further changes anyone would like to see? |
7026db7
to
6378519
Compare
Friendly ping again |
Thank you for your contribution! |
Is anything else needed for this PR? |
6378519
to
56dd8c1
Compare
Thank you for your contribution! |
Still waiting on feedback about this PR; it's not stale as far as I know. |
Thank you for your contribution! |
Still not stale. |
When using `send_string_with_delay`, if the string contains capital letters, it gets sent to `send_char`, which does not insert the delay between pressing the modifier keys needed to type the shifted letter. This results in key codes being sent unshifted in some situations, such as ssh connections where the keyboard is too fast for the modifier taps to register. This commit inesrts a delay between every modifier tap when they are detected.
56dd8c1
to
4f8d740
Compare
There are some CI failures about the resulting binary size being too large. It seems unlikely to me that my change is related at all. |
Anything I can do for this PR? |
This was done for ARM in qmk#19280, but there is another copy of these functions that needed to be fixed too.
Description
When using
send_string_with_delay
, if the string contains capital letters, it gets sent tosend_char
, which does not insert the delay between pressing the modifier keys needed to type the shifted letter. This results in key codes being sent unshifted in some situations, such as ssh connections where the keyboard is too fast for the modifier taps to register.This commit inesrts a delay between every modifier tap when they are detected.
Types of Changes
Checklist