Evdev

evdev is the open source input driver for many input devices like keyboards, mice, joysticks and more.

Kernel
You need USB support, if you have an USB input device. Also you need to activate the following kernel options:

Keyboard layout
To set the default layout copy the file to  and edit the keyboard section, e.g. for a german layout: