Field Input Using Linux Machines
Note to all Linux users: When you click the forward slash character (/) from your numeric keypad - with the Num Lock function on - Linux treates the forward slash character (/) as a division symbol and assigns the forward slash character a different ASCII number.
This behavior occurs because Linux often interprets the numeric keypad's divide key (/) as the mathematical division symbol (÷ or÷) or as a specialized keypad operator, rather than a simple forward slash, when Num Lock is active.
Here are the most effective ways to fix this in Linux, ordered by ease of use.
Method 1: Change Keyboard Layout Options (Easiest)
Most Linux distributions (Mint, Ubuntu, Gnome/KDE) enable you to force the numpad to always enter digits/standard symbols.
- Open System Settings > Keyboard > Layouts (or "Input Sources").
- Click Options...
- Look for Miscellaneous compatibility options or Numeric keypad.
- Select "Numeric keypad keys always enter digits" or "Default".
- For KDE: System Settings > Input Devices > Keyboard > Advanced > Miscellaneous compatibility options.
Method 2: Remap with xmodmap
If the settings GUI does not work, you can force the key to map to the slash symbol (/) using xmodmap.
- Open a terminal.
- Create a file named
.Xmodmapin your home directory:xmodmap -pke > ~/.Xmodmap - Edit the
~/.Xmodmapfile and find the line forKP_Divide. - Change it to:
(Note: Keycode 106 is common for numpad slash, but may differ. Usekeycode 106 = slash slash slash slash slash slash slashxevto find your actual keycode if necessary). - Apply the change:
xmodmap ~/.Xmodmap. - Add
xmodmap ~/.Xmodmapto your startup applications to make it permanent.
Method 3: Fix VS Code Specific Issues
If this only happens in VS Code, it is a known keybinding issue where the keypad is misinterpreted.
- Open VS Code settings (
Ctrl+,). - Search for
"keyboard.dispatch". - Change the setting from
"code"to"keyCode".