Table of Contents

Ubuntu - Keyboard - Map all keys

Sometimes Multimedia keys, Super Key, Printscreen key are not working or not even detected by xev.


Generate the current keycode map

xmodmap -pke > .Xmodmap

NOTE: To detect what the keycode is for a specific key, use command:

xev -event keyboard

Add these lines to the ~/.xinitrc file.

~/.xinitrc
usermodmap=$HOME/.Xmodmap
sysmodmap=/etc/X11/xinit/Xmodmap
 
if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi
 
if [ -f $usermodmap ]; then
    xmodmap $usermodmap
fi

References

XF86 keysims