In Slackware, one way to get the keyboard layout of your choice is by dropping a configuration file in "xorg.conf.d", which is the "new" directory for X.Org configuration files, as opposed to the old method of editing the "xorg.conf" directly.
Copy the file /usr/share/X11/xorg.conf.d/90-keyboard-layout.conf to
/etc/X11/xorg.conf.d/.
Now, edit the file you have just copied and change the value of the XkbLayout
option to the layout you want. For example, for Portuguese layout you have the
following line:
Option "XkbLayout" "pt"
Other files from /usr/share/X11/xorg.conf.d/ can be copied to xorg.conf.d
and modified to customize other devices.
Tags: slackware