Open aimfiz opened 1 year ago
This is quite annoying, I managed to get a work-around for my use-case by using PowerToys Keyboard Manager, by rebinding Alt-Space shortcut to Escape, since in my application Escape is same as Alt, but then I always have to do Alt-Space Space to get Alt-Space. Would be really nice if this could be fixed somehow, wherever this get's lost.
@terlar, thank you for your response, which helped me find a workaround. In PowerToys Keyboard Manager, make a shortcut mapping Alt-Space to Alt-F13 for application "msrdc.exe", and in WSL map keycode 191 to space using "xmodmap -e 'keycode 191 = space'". This seems to work well, making all WSL windows see alt-space as the ordinary key combination alt-space, while it retains its usual meaning in Windows windows (pulling up the application menu).
Could there maybe be a way to configure keybindings for msrdc.exe? I would also like to use Alt-Space in many of my GUI applications (e.g., emacs).
Could there maybe be a way to configure keybindings for msrdc.exe? I would also like to use Alt-Space in many of my GUI applications (e.g., emacs).
The PowerToys Keyboard Manager does provide a way to configure keybindings for msrdc. Are you saying you're unable to get my workaround to work? Or are you just saying there should be a more convenient way to do it?
Here's what my Keyboard Manager shortcut looks like in PowerToys:
And here's the operative line in my ~/.bash_profile:
xmodmap -e 'keycode 191 = space'
With those measures in place, starting emacs with "emacs -Q" and then entering the key sequence Ctrl-h c Alt-space
causes emacs to respond with "M-SPC runs the command just-one-space".
If you just want the default behavior for emacs Alt-space
, it's easier to remap F13
to the function just-one-space
than messing with xmodmap.
(keymap-global-set "<XF86Tools>" 'just-one-space)
In PowerToys, you would then map Alt-space
to F13
, not Alt-F13
.
I'm also having this trouble with my emacs where I bind ALT+SPACE to specific function
Could there maybe be a way to configure keybindings for msrdc.exe? I would also like to use Alt-Space in many of my GUI applications (e.g., emacs).
The PowerToys Keyboard Manager does provide a way to configure keybindings for msrdc. Are you saying you're unable to get my workaround to work? Or are you just saying there should be a more convenient way to do it?
Here's what my Keyboard Manager shortcut looks like in PowerToys:
And here's the operative line in my ~/.bash_profile:
xmodmap -e 'keycode 191 = space'
With those measures in place, starting emacs with "emacs -Q" and then entering the key sequence
Ctrl-h c Alt-space
causes emacs to respond with "M-SPC runs the command just-one-space".
If you are using emacs in wslg, replace the second step in @aimfiz 's solution to add xmodmap
setting in emacs.
Alt+Space-->Alt+F13
in PowerToys Keyboard Manager.(eshell-command "xmodmap -e 'keycode 191 = space'")
into your emacs init file, for example init.el
.
Windows build number:
10.0.22621.1702
Your Distribution version:
22.04
Your WSL versions:
WSL version: 1.2.5.0 Kernel version: 5.15.90.1 WSLg version: 1.0.51 MSRDC version: 1.2.3770 Direct3D version: 1.608.2-61064218 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22621.1702
Steps to reproduce:
xev -event keyboard
[type alt-space]WSL logs:
No response
WSL dumps:
No response
Expected behavior:
Actual behavior:
If pressing alt-space brought up the usual Windows menu for the window, then I would assume that that was the intended behavior, but it doesn't do that either. It just does nothing. If it's supposed to bring up a Windows menu, and that bug gets fixed, then please consider this bug report to be a feature request for some way to turn that feature off and have the alt-space usable by X11 applications.