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+Alt+[Left/Right Arrow] shortcut #188

Open
JChrist opened this issue May 11, 2021 · 17 comments
Open

Ctrl+Alt+[Left/Right Arrow] shortcut #188

JChrist opened this issue May 11, 2021 · 17 comments
Labels
bug Something isn't working

Comments

@JChrist
Copy link

JChrist commented May 11, 2021

Environment

Windows build number: 10.0.21376.0
Your Distribution version: Ubuntu 20.04
Your WSLg version: 1.0.19

Steps to reproduce

  • Open IntelliJ IDEA from WSL
  • Click Ctrl+Alt+Left Arrow or Ctrl+Alt+Right Arrow to navigate to different parts of code

Expected behavior

I would expect the shortcut to be captured by the IDE and navigate back/forward

Actual behavior

It seems that the keyboard shortcust is captured from WSLg, sometimes causing the IDE to crash, or other times to disappear (both the window and the taskbar icon) and re-appear after a few seconds (with changed icon in the taskbar)

@JChrist JChrist added the bug Something isn't working label May 11, 2021
@Matsemann
Copy link

Matsemann commented May 14, 2021

Same issue here. Happens with other programs as well, like Gimp. Pressing ctrl+alt+left and then escape makes weird stuff happen. Wonder if it's because it's normally a way to switch workspace in Ubuntu?

Tried disabling it https://askubuntu.com/questions/82007/how-do-i-disable-ctrlaltleft-right
but no difference.

Ohh well, I've earlier had to remap the keybinding in intellij / pycharm to shift+alt+left/right instead, as ctrl+alt+left/right was used for some VM/thin client stuff.

@hideyukn88
Copy link
Member

Hi, thank you for reporting the issue, I'm not familiar with that specific application's behaver, but tried using "xev -event keyboard" to see what keystroke events were sent, and the last arrow input is not sent to xev, but it's recognized as release of L-Control and L-Alt key (even I'm pressing those keys).

Doing same on Ubuntu desktop (running natively, not on WSLg), the last arrow (Left or Right) input is not delivered to xev, too, but pressing arrow key doesn't generate release of other 2 keys. By default, Ctrl+Alt+Arrow Up/Down seems assigned to work space change shortcut, this might be related, but I'm not sure.

If you have a working settings (means the key combination works with applications) with other Linux environment, would you please check what do you see with xev with that key combination ? thanks!

[Below is what I see with WSLg]

I pressed L-Control
KeyPress event, serial 28, synthetic NO, window 0x1000001,
root 0x515, subw 0x1000002, time 182396889, (50,42), root:(2626,604),
state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False

I pressed L-Alt (while holding L-Control
KeyPress event, serial 28, synthetic NO, window 0x1000001,
root 0x515, subw 0x1000002, time 182400009, (50,42), root:(2626,604),
state 0x14, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False

I pressed Left-Arrow (while holding L-Control and L-Alt)
KeyRelease event, serial 28, synthetic NO, window 0x1000001,
root 0x515, subw 0x1000002, time 182402431, (50,42), root:(2626,604),
state 0x1c, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x1000001,
root 0x515, subw 0x1000002, time 182402431, (50,42), root:(2626,604),
state 0x14, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

@hideyukn88
Copy link
Member

Actually, at least on my environment, the last array key input is not delivered from Windows side, the key sequence Windows sends to WSLg matches what shows in xev. If this is the case, I think you will need to remap the shortcut to something-else. I will continue to check if this is used for some shortcut at Windows side.

[12:54:28.503] RDP backend: xf_input_keyboard_event code=1d ext=0 vk_code=a2 scan_code=25 pressed=1, idle_inhibit=1
[12:54:28.864] RDP backend: xf_input_keyboard_event code=38 ext=0 vk_code=a4 scan_code=40 pressed=1, idle_inhibit=2
[12:54:29.234] RDP backend: xf_input_keyboard_event code=38 ext=0 vk_code=a4 scan_code=40 pressed=0, idle_inhibit=1
[12:54:29.234] RDP backend: xf_input_keyboard_event code=1d ext=0 vk_code=a2 scan_code=25 pressed=0, idle_inhibit=0

@JChrist
Copy link
Author

JChrist commented May 15, 2021

hi @hideyukn88 , thanks for taking a look at this.
I'm using VcXsrv to show Intellij, where the Ctrl+Alt+Arrows works as expected.
So, I started xev -event keyboard using VcXsrv as the display server and here is the output:

I pressed L-Ctrl
KeyPress event, serial 25, synthetic NO, window 0x300001,
root 0x36e, subw 0x0, time 3463312, (137,121), root:(273,280),
state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False

I pressed L-Alt while holding L-Ctrl
KeyPress event, serial 28, synthetic NO, window 0x300001,
root 0x36e, subw 0x0, time 3464406, (137,121), root:(273,280),
state 0x14, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False

I pressed L-Arrow while holding L-Ctrl and L-Alt
KeyPress event, serial 28, synthetic NO, window 0x300001,
root 0x36e, subw 0x0, time 3466609, (137,121), root:(273,280),
state 0x1c, keycode 100 (keysym 0xff51, Left), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x300001,
root 0x36e, subw 0x0, time 3466703, (137,121), root:(273,280),
state 0x1c, keycode 100 (keysym 0xff51, Left), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

** I released L-Alt**
KeyRelease event, serial 28, synthetic NO, window 0x300001,
root 0x36e, subw 0x0, time 3469437, (137,121), root:(273,280),
state 0x1c, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

** I released L-Ctrl**
KeyRelease event, serial 28, synthetic NO, window 0x300001,
root 0x36e, subw 0x0, time 3469968, (137,121), root:(273,280),
state 0x14, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

@hideyukn88
Copy link
Member

Update: Ctrl+Alt+[Left/Right Arrow] is registered for other shortcut functionality in RDP client software at Windows side, this is why this key sequence is not reported to WSLg.

@Matsemann
Copy link

Ahh, I should have guessed that. As I commented I have had to remap that key binding earlier when using remote thin clients / rdp as well. It would take one out of the session and back to one's own computer.

@JChrist
Copy link
Author

JChrist commented May 20, 2021

OK, that was my initial though as well.
Is there some way to disable it in the RDP client at Windows side? In fact, disable every shortcut in the RDP client?

@hideyukn88
Copy link
Member

Hi, yes, we have already followed up with the responsible team for RDP client software at Windows side, to give us an option to do so, unfortunately, due to the change in Windows, not in WSLg, the solution may not be available until future release of Windows, thanks for feedback!

@selivan
Copy link

selivan commented Jun 28, 2021

I also confirm the problem, it appears in PyCharm(Java-based IDE) running in WSL with WSLG. Ctrl+Shift+RightArrow and Ctrl+Shift+LeftArrow modify the window width.

Strangely though, it does not appear in Geany(GTK3 application) running in WSL with WSLG. Same keys just do what they are supposed to do - select text to the next/previous word boundary.

Windows 10 build: 21390.2025

Edit: got Windows 11 with new update, build 22000.51, the issue is still there.

@facboy
Copy link

facboy commented Oct 28, 2021

apparently the RDP client in the microsoft store doesn't have this behaviour...is it possible to configure which RDP client is used?

@hyukchan
Copy link

Hello, I also have this issue.
Any update regarding this ?
Did anyone find any workaround solution ??? Thanks !

@vertliba
Copy link

Hello!
Any updates or solutions?

@bluelu
Copy link

bluelu commented Aug 10, 2022

I have the same issue, any updates?

@vertliba
Copy link

The same issue((

@hideyukn88
Copy link
Member

@bluelu, we are working on this, and it is working internally, but this requires updates in RDP client software, thus it would require more coordination internally, thanks for checking!

@kartiksubbarao
Copy link

kartiksubbarao commented Sep 3, 2022

@hideyukn88 If you can provide a solid fix for the RDP client always eating Ctrl+Alt+[Left/Right Arrow], that will also help users beyond wlsg! This has been an issue for a long time, see this post for example:

https://superuser.com/questions/327866/remote-desktop-sending-ctrl-alt-left-arrow-ctrl-alt-right-arrow-to-the-remote-p

@flybyray
Copy link

flybyray commented Nov 28, 2022

@bluelu, we are working on this, and it is working internally, but this requires updates in RDP client software, thus it would require more coordination internally, thanks for checking!

Are there some upstream trackers to subscribe with?

I think that the topic is now gaining in importance: November 22nd, 2022 - The Windows Subsystem for Linux in the Microsoft Store is now generally available on Windows 10 and 11 - Github discussion

At least a workaround how to get a clean reconnect to a running application would be great.

Regarding

https://superuser.com/questions/327866/remote-desktop-sending-ctrl-alt-left-arrow-ctrl-alt-right-arrow-to-the-remote-p

Somehow rdp settings are also specified by options and read in the background from wslg.rdp / wslg_desktop.rdp files in "c:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_1.0.0.0_x64__8wekyb3d8bbwe\".
In those property files there could be switches for keyboard_hook ( see answer ).

But this wslg feature is really great news!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants