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

How to set keymap in archWSL #18

Closed
olesendan opened this issue Jul 12, 2021 · 7 comments
Closed

How to set keymap in archWSL #18

olesendan opened this issue Jul 12, 2021 · 7 comments
Labels
question Further information is requested

Comments

@olesendan
Copy link

Hi.

I'm trying to set keymap in archlinux.

Ive tried to two approaches

  1. echo "keymap=us" >> /etc/vconsole.conf + echo "source /etc/vconsole.conf > ~/.bashrc
  2. change LANG and LANGUAGE in /etc/locale.conf to en_us.UTF-8.

either way do not work.

So is there a way to set keymap in archWSL

Greetings from Denmark
Dan Olesen

@koumaza
Copy link
Member

koumaza commented Jul 13, 2021

It might work when enabled Systemd.
Please follow this: https://wsldl-pg.github.io/ArchW-docs/Known-issues/#wsl2

@yuk7
Copy link
Contributor

yuk7 commented Jul 15, 2021

Where keymap used?
Command window? or WSLg? VNC? or etc..?

The command window is a Windows implementation, and I think that setting is used.
I think WSL is a VM container and the keyboard is used only indirectly.

@yuk7 yuk7 added the question Further information is requested label Jul 15, 2021
@olesendan
Copy link
Author

Hi
Thank you for your answers.

I'm using the terminal inside WSL. Running in Windows Terminal.
My scenario is:
Windows 10 with a keyboard with danish layout.
WSL2 with archWSL installed. On this host I would like to use a keyboard with US layout.

So I have tried to set the keymap inside the ArchWSL host. Is this wrong?

Greetings from Denmark
Dan Olesen

@yuk7
Copy link
Contributor

yuk7 commented Jul 16, 2021

Yeah,, That part (terminal window) is handled by the Windows OS.
If you are physically using a different keyboard, you can set KeyboardTypeOverride of the registry.

but I hope that helps.
yuk7

@koumaza
Copy link
Member

koumaza commented Jul 18, 2021

@olesendan So I have tried to set the keymap inside the ArchWSL host. Is this wrong?

That is not wrong.
Normally, keyboard input as scan code goes directly to Linux kernel. Linux kernel then maps scan code to a key code and sends it to Console, Display, etc.
But in WSL, keyboard input as scan code goes to Hyper-V through NT Kernel. Then Hyper-V sends input as key code to Linux Kernel. Or NT Kernel sends key code to Console Host, Windows Terminal etc.
Therefore, NT kernel needs to be configured to map the scan code as intended.

Set in here. (Screenshot)

screenshot0
screenshot1

@olesendan
Copy link
Author

olesendan commented Aug 4, 2021 via email

@koumaza
Copy link
Member

koumaza commented Aug 4, 2021

We glad helped you☺️

@koumaza koumaza closed this as completed Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants