Skip to content
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

CTRL Modifier is sent later than subsequent Keypresses to the target system #6491

Open
kladderadeng opened this issue Nov 2, 2024 · 8 comments
Labels

Comments

@kladderadeng
Copy link

Describe the bug
When remove accessing another System and for example using CTRL+C or CTRL+V for Copy & Paste, most of the time a c or v is written. The Key combination only works for me, when I wait half a second or a second after depressing the CTRL Key until I press C or V. When using Copy & Paste over a Remote session often, this makes it very cumbersome to use. I feel this is more an issue in the Webbrowser than when using the Router Windows executable. But the latter one seems to miss the feature to transfer the Clipboard from the Remote to the local System, so it is less preferred.

To Reproduce
Steps to reproduce the behavior:

  1. Remote access another Windows 11 24H2 System either through the Browser or through the Windows Router executable.
  2. Select any kind of text on the Screen (for example in Notepad)
  3. Press CTRL+C or CTRL+V as you probably will when working locally (pretty short key presses)
  4. You will see a c or a v on the screen and whatever Text you selected will be substituted by that single character instead of copying it into / pasting it from the clipboard.

Expected behavior
I would expect that keys that are pressed in a specific order are sent to the destination in that order. But this does not seem to be the case when CTRL is involved.

Server Software (please complete the following information):

  • OS: Ubuntu Server 22.04.5 LTS
  • Virtualization: Docker Image ghcr.io/ylianst/meshcentral:1.1.32
  • Network: Both testsystems are on the same Network (LAN), but Meshcentral runs through Traefik and I am using Hybrid mode
  • Version: 1.1.32
  • Node: 20.15.1

Client Device (please complete the following information):

  • Device: PC
  • OS: Windows 11 23H2
  • Network: LAN (Source PC) to VLAN (Traefik + Meshcentral) to LAN (Destination PC)
  • Browser: Microsoft Edge and Vivaldi
  • MeshCentralRouter Version: 1.8.9021

Remote Device (please complete the following information):

  • Device: VM under XCP-ng
  • OS: Windows 11 24H2
  • Network: LAN
  • Current Core Version: Dec 9 2022, 1874374695

Additional context
Add any other context about the problem here.

Your config.json file

{
  "$schema": "https://raw.githubusercontent.com/Ylianst/MeshCentral/master/meshcentral-config-schema.json",
  "settings": {
    "Cert": "meshcentral.my.domain",
    "plugins":{"enabled": false},
    "_mongoDb": null,
    "cert": "localhost",
    "_WANonly": true,
    "_LANonly": true,
    "_sessionKey": "redacted",
    "port": 443,
    "aliasPort": 443,
    "redirPort": 80,
    "redirAliasPort": 80,
    "AgentPong": 300,
    "TLSOffload": true,
    "SelfUpdate": false,
    "AllowFraming": false,
    "Minify": 1,
    "WebRTC": true
  },
  "domains": {
    "": {
      "title": "MyLab",
      "title2": "Meshcentral",
      "minify": true,
      "NewAccounts": false,
      "localSessionRecording": false,
      "_userNameIsEmail": true,
      "certUrl": "meshcentral.my.domain",
      "allowedOrigin": [ "meshcentral.my.domain" ]
    }
  },
  "_letsencrypt": {
    "__comment__": "Requires NodeJS 8.x or better, Go to https://letsdebug.net/ first before>",
    "_email": "[email protected]",
    "_names": "myserver.mydomain.com",
    "production": false
  }
}
@si458
Copy link
Collaborator

si458 commented Nov 2, 2024

Have u tried using the 'use remote keyboard map' option under settings?

Sometimes, this is needed, and sometimes, it isn't

For example when i control my mac, i need to untick it, but when I load up utm on my remote mac and then try typing inside the vm window, it won't type, so I have to tick the 'use remote keyboard map' then I can type inside the vm window

@kladderadeng
Copy link
Author

Thank you for your reply. I just fired up the test environment again and this option does not help. I do not have problems with typing in general. I touch type decently fast and when I do that in a remote session, it all seems to work fine. Even Upercase / Lowercase, where SHIFT is used as a modifier. The issue seems to be specific about the CTRL Key. I suspect this is handled. Even the ALT key seems to work fine... but with CTRL I have to wait .5 - 1 second until it does its thing. I would not even open the issue if the Router had more options (like bi-directional Clipboard support like we have in the browser) and would just stick to the Router ;-)

@si458
Copy link
Collaborator

si458 commented Nov 2, 2024

The meshcentralrouter has clipboard built in if I'm correct, u don't need to enable/disable any options?

Also have u tried going browser fullscreen?
Use edge/chrome, connect to device, then HOLD SHIFT while clicking the fullscreen icon,
This enabled the browser to take full control of all key presses, so it might help, maybe?

Edit. The is also other issues already open about the ctrl issue but they explain its sticky and doesn't undo the keypress

@kladderadeng
Copy link
Author

Yes, you are right. The meshcentralrouter has clipboard built in. I made the mistake and activated the "Automatically send clipboard" feature in the router, which automates the clipboard but only in one direction. When I turn that off, I see the 2 clipboard Icons for manual transfer. Thank you!

I just tried browser fullscreen with SHIFT + Click on the fullscreen icon. This did not change the CTRL behavior.
I also just found out that ALT-GR is not working either in the Browser, but that is not a big issue because you can emulate it with CTRL+ALT (requires also the waiting time for CTRL ;-)).

I did not find the other CTRL issue, I am sorry. But I can confirm that it is not sticky. It just takes the 0,5 to 1 second to "activate".

Update! It only seems to affect the LEFT CTRL Key. When I use the right one, it works instantly like I would expect. I never tried, because left CTRL+V / C need only 1 hand to activate.
Also I went to www.keyboardtester.com on the Remote machine to see which keys activate when. When I press for example SHIFT 5 times in quick succession, all 5 key presses are registered. If I do this with CTRL, depending how quick i am I get 0-2 registered. CTRL seems to be a special snowflake here ;-)
I recorded a short video about this, but I do not know how helpful this is.

ctrl_vs_shift.mp4

@si458
Copy link
Collaborator

si458 commented Nov 3, 2024

I made the mistake and activated the "Automatically send clipboard" feature in the router, which automates the clipboard but only in one direction

erm thats not right if i remember it should be both ways???
i would open an issue in the meshcentralrouter repo about that
and we can look into it but at least u can use the manual buttons!

as for the CTRL key issue,
sounds mad but you screenrecording shows you use webrtc,
try disabling it in config.json webrtc: false
restarting meshcentral and see if the issue still happens?

@kladderadeng
Copy link
Author

Thank you for your comment. I just tried with webrtc: false and a restart, still the same issue. Left CTRL is delayed, right CTRL is fine. Is there some kind of "communication log" that logs all the keypresses that are sent back and forth that might help here?

I will double check the clipboard issue in router and then go to the other Repo ;-)

@si458
Copy link
Collaborator

si458 commented Nov 3, 2024

you can use ?trace=1 in your address bar to enable to websocket debug
and you can also use ?redirtrace=1 to debug the tunnel traffic that the mouse/keyboard uses
or use them both together at the same time ?trace-1&redirtrace=1
then check ur developer tools of the browser and watch the console.log fly by haha

@kladderadeng
Copy link
Author

Oh yea. That worked! Thank you very much. As long as you do not move the mouse, that information is quite readable / traceable ;-)

Here are the results:
image

Green: Left Shift Depress and Release
Red: Left CTRL Depress and Release (only Depress is transferred)
Purple: Right CTRL Depress and Release

When I hold the left CTRL longer, Depress and Release is recorded.

Here I try a CTRL+C like you would normally do it, pretty quickly (first CTRL, then C of course).
043 is depressing C
111 is depressing CTRL (I pressed that BEFORE the C, I am 100% sure!)
143 is releasing C
There is no releasing of CTRL recorded.

image

Here I try a CTRL+C while pressing CTRL, wait a bit and then pressing C:
011 is depressing CTRL (I waited a bit before pressing the next key)
043 is depressing C
143 is releasing C
111 is releasing CTRL
image

I am not sure how this is helpful, but to me it looks like it takes longer for the program to send the CTRL through the connection and when I do a CTRL+C quickly, c is sent before the CTRL and of course also arrives before the CTRL on the remote system. The only thing that this test is telling me at the moment is, that this should not be an issue on the remote side. If what I see in the Debug logs is what leaves my PC, my side fails to send a CTRL as quickly as the other keys and this messes up the order in which I am typing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants