I have a spanish keyboard, and my gentoo was using the default US keymap, so a lot of keys was difficult for me to find, to change this behaviour I did this.

  1. I edited the /etc/conf.d/keymap and made sure this line was in there:
KEYMAP="es"
  1. I added keymap to the starting scripts

sudo rc-update add keymaps boot

  1. I made sure these lines were in my X config file /etc/X11/xorg.conf in the “InputDevice” section
Option	    "XkbRules" "xorg"
Option	    "XkbLayout" "es"

You can also change it from the command line with:

setxkbmap es