Fixing Number Key (Caps Lock) Issue in Arch Linux
If you're a new contributor to the Arch Linux community, you might encounter a peculiar issue with your keyboard layout, specifically with the number keys when the Caps Lock is on. This article will guide you through understanding the issue and provide a solution to fix it.
Understanding the Issue
The default keyboard layout in Arch Linux is set to behave as a US keyboard. This means that when the Caps Lock is activated, it functions as a second Shift key, affecting alphabetic keys only. However, some keys, like the number keys, may not behave as expected due to this setup.
Identifying the Problem
To confirm if you're experiencing this issue, open a terminal and type the following command:
setxkbmap -query
If the output shows layout: us, then you're using the default US keyboard layout.
Solution: Modifying the Keyboard Layout
To resolve the issue, you can create a custom keyboard layout file. Follow these steps:
- Create a new file with the following command:
sudo nano /etc/X11/xorg.conf.d/00-keyboard.conf
- Add the following content to the file:
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "us"
Option "XkbModel" "pc105"
Option "XkbOptions" "compose:rwin,terminate:ctrl_alt_bksp,lv3:ralt_switch"
EndSection
- Save and close the file.
The above configuration changes the keyboard layout to US with some additional options. The important option for this issue is lv3:ralt_switch. This option maps the Right Alt key to function as a third level shift, affecting number keys and other special characters. The Caps Lock key will now behave as a Shift key for alphabetic keys only.
Verifying the Fix
To ensure the issue is resolved, restart your system and check the keyboard layout again with the following command:
setxkbmap -query
If the output shows the correct layout and options, the issue should be fixed.
References
- Arch Linux Wiki: Xorg/Keyboard configuration
- X.org documentation: xorg.conf manual