-
-
Notifications
You must be signed in to change notification settings - Fork 39.5k
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
Windows Remote Desktop Cannot Recognize Shifted Keys like KC_LPRN 100% of the time #1037
Comments
Maybe, but what I'm seeing is a different effect and i cannot remember this
being a problem with earlier builds.
…On Thu, Jan 26, 2017, 12:01 PM Priyadi Iman Nurcahyo < ***@***.***> wrote:
This probably has nothing to do with QMK. You might want to read this
<https://answers.microsoft.com/en-us/windows/forum/windows_vista-windows_programs/remote-desktop-shift-key-delay/c00f1ca6-baad-4f01-a44a-874358067041>
or this
<https://superuser.com/questions/219461/shift-and-control-keys-out-of-sync-with-normal-keys-over-rdp>
.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1037 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFl50LxT1Sy7jt461f4_I5Lyd1qwa3J_ks5rWN92gaJpZM4Lu1c1>
.
|
One interesting observation is that there are two Edit Maybe it would be good to run Switch Hitter on both the host and the virtual machine at the same time, if possible, to see if there's any difference. If that's not possible, then maybe just running it on the host could show some other pattern. |
Host Machine
I cannot run Switch Hitter and have it collect data from both at the same time because it only grabs keystrokes when it is the active window. However, I CAN use AutoHotkey. Here is what I see when I snoop using AHK.
What I need to try is to create a macro that adds in delays between shifting and pressing. |
Those reports doesn't make sense, even the generated keycodes are messed up. But did you try this workaround, which many people reported working?
Even if that fixes the situation, it's still possible that there's something in QMK that breaks it, as someone reported it was broken by a Windows update for "IntelliType" |
I did try what they recommended, and while it worked, it had a side effect of blocking remote desktop shortcut keys like Alt-Tab. So, showstopper. I did find a solution, though. A delay needs to exist between registering the shift and pressing the key.
What would the best way to address this? My thought would be to add in a delay constant (default = 0) between registering the modifier and registering the key. Maybe mod
|
I would do it at a lower level in If any modifiers have been changed since the last report, then you could just do a wait after sending the report. I think it's the safest to check for all changes rather than just key down, since there's probably the same problem with releasing shift as well. Other modifiers might have the same problem too. A slightly more advanced version of the algorithm would be to not wait immediately after sending the report, but only when trying to send another conflicting report too soon afterwards. But this would require a timer and saving of the previous report to detect changes. The saving might not be strictly necessary if you hook into the functions that modifies it, like |
What about adding an if-then to the above code to detect changes to
This way only gives you a delay if your mods changed. Another delay can be used to pad the entire packet in case we run into problems with key-ups and key-downs for non-modifiers. Both delays would be optional and default to 0.
Hmm... I don't know... This may be overkill. Why does it matter that there is a delay after a keypress if there is no follow-up keypress? |
Yes, that was essentially what I was thinking. There's a bug in your code snippet though, And yes you are right that the advanced solution most likely is an overkill. It would reduce or eliminate the lag when you press shift before the actual key. But it's probably so small that it's not noticeable in any case. One thing that has to be remembered about delays like these, is that the normal matrix scan loop is not run during the wait, so it doesn't react to new keystrokes during that time. It also doesn't run the debouncing logic. So on most of our debouncing logic implementations, which just counts the number of scans, there would be additional delays. Delays could also disrupt visual or audio effects. So only enabling them through ifdefs is a good idea. If the negative effects are too big it could even be something that can be toggled by a macro key. |
Could we be more surgical than what I showed in my second pseudocode snippit? The true issue wasn't that modifiers need a delay. It was that events that force one or more keys to be registered at once need to have a delay, and this is mainly caused by modifiers and keys. Humans firing modifiers by themselves are not the issue. The true culprets are...
That is what I was initially targeting with the first snippit, but I may not have chosen the right place. Thoughts? |
I am currently in trials for a 10ms delay. I will report back to see if it solved the issue. My semifinal code is...
|
The packet delay seems to be working for me. I have not encountered the issue. I will work to merge the changes in later this week. |
@IBNobody Have you ever tried it with higher latency connection? Like 300ms or more. I think I got the same problem with the IPMI remote management thingy that came with some server motherboards. |
@priyadi I can try it tomorrow by accessing a machine in Malaysia. No promises on how bad the latency will be. But half-a-world is a good enough field test for me.. |
@priyadi Yes, it seems to work in a remote desktop session from the US to Malaysia. I see significant input lag, but the key combos work correctly. |
And some formatting and grammar corrections. Closes qmk#1037
* Add caveats for shifted characters And some formatting and grammar corrections. Closes #1037 * Fix spelling of remote * Fix spelling error * Remote not Remove * Remote not Remove
* Add caveats for shifted characters And some formatting and grammar corrections. Closes qmk#1037 * Fix spelling of remote * Fix spelling error * Remote not Remove * Remote not Remove
* Add caveats for shifted characters And some formatting and grammar corrections. Closes qmk#1037 * Fix spelling of remote * Fix spelling error * Remote not Remove * Remote not Remove
* Add caveats for shifted characters And some formatting and grammar corrections. Closes qmk#1037 * Fix spelling of remote * Fix spelling error * Remote not Remove * Remote not Remove
* Add caveats for shifted characters And some formatting and grammar corrections. Closes qmk#1037 * Fix spelling of remote * Fix spelling error * Remote not Remove * Remote not Remove
Wow, this really helped me! Thank you so much! I'm often dealing with remote connections like Citrix or other access methods where I need to jump over multiple RDP connections. I have no choice but to use them. This issue really bothered me and I had to create macros for important things, which was really annoying. I've implemented this fix in my current QMK version and this works really well! I've tested it over a few weeks and haven't encountered any issues. I have removed all of my workaround-macros and replaced them with regular modifiers. PS: My sweat spot was with KEYBOARD_MOD_PACKET_DELAY 20 |
Currently, when you enable the wizard, it brings up a single video. While this is useful, I think it might be useful for users to see that there's a playlist of other related tutorials as well, so I have edited the embed link to include the playlist.
When attempting to send a "(" key via KC_LPRN to a remote desktop session, the LShift operation does not always register correctly. Instead of a "(", I get a "9".
This is a showstopper for me, as I do most of my work-work through remote desktop sessions.
I used Switch Hitter to get a log of what was happening. In the log below, I hold down a key assigned to KC_LPRN for 6 seconds. You can see immediately that LShift gets sensed as UP.
This does not happen 100% of the time either. Sometimes it works flawlessly, repeatedly. Other times, all I get are 9's.
Here is an example of a success.
I have no problems in my normal Win10 environment.
My debounce was set to 5. I switched it to 10 without effect.
The text was updated successfully, but these errors were encountered: