Extra keyboard keys
Q: How can I get my Extra Keyboard Keys to work?
A:There are many ways to get Extra Keys to work. Keytouch has been the easiest that I have seen.
- Install keytouch package from the community repo:
# pacman -S keytouch
Alternative way (build it yourself)
- Download the keytouch PKGBUILD from here. Don't forget the files "keytouch.daemon" and "keytouch.desktop", they are under the sources list on aur. Put these 2 files and the PKGBUILD in the same directory.
- Run makepkg
- Install Package Using Pacman
pacman -A keytouch-$VERSION.pkg.tar.gz
Make Keyboard File
Note: You need a keyboard file for your keyboard model. The package build includes some of them. You can also check http://keytouch.sourceforge.net/dl-keyboards.html
If your model is not included in the keytouch package you will need to create one for yourself:
- Install keytouch-editor:
# pacman -S keytouch-editor
- Make sure you have evdev loaded (you should not need to do this if you using the stock kernel)
# modprobe evdev
- We are going to need to make a keyboard file which is very simple. You need to find out which input device is your keyboard first:
# ls /dev/input/
Every event device (like a keyboard or a mouse) is related to one of these ﬁles. To ﬁnd out which ﬁle belongs to your keyboard, run:
# keytouch-editor /dev/input/eventX mykeyboardconfig
Replace the X by a number. KeyTouch editor will ﬁrst show some information about the device, including its name (”Input device name”) that can tell you if you have chosen the correct event device. KeyTouch editor asks you to press one of the extra function keys. If the program continues after pressing the extra function key, you have chosen the right event device. If not terminate the program by pressing Ctrl+C and try another event device. Note that when your keyboard is connected via USB there are two event devices: /dev/input/eventA (where A is replaced by a number) for all ”normal” keys and /dev/input/eventB (where B = A+1) for the extra function keys.
- After you have found the correct device, follow the steps. keytouch-editor asks your name and the name of the manufacturer and model of your keyboard.
- Now it is time to tell keytouch-editor about your extra function keys. You will see the following message:
Press an extra function key or press enter to finish...
If your keyboard is connected via USB or you started keyTouch editor with the ”–acpi” option, you will not see this message, but instead:
Press return to a new key or enter F followed by return to finish...
- First you will have to press the extra function key so that the program knows which key you mean. It is important that you do not press any other key than the extra function key. After pressing the key you will be asked to enter the keys name, keycode and default action.
- Key name
Choose an appropriate name for the key. If there is for example a text label on the key, use the label as the key’s name.
Use one of the keycodes listed below. It actually doesn’t matter which keycode you choose. However it is recommended that you choose a keycode that matches the best the function of the key. A keycode may only be used once in a keyboard ﬁle.
AGAIN EJECTCLOSECD MAIL REFRESH ALTERASE EMAIL MEDIA REWIND BACK EXIT MENU RIGHTMETA BASSBOOST FASTFORWARD MOVE SCROLLDOWN BOOKMARKS FILE MSDOS SCROLLUP BRIGHTNESSDOWN FINANCE MUTE SEARCH BRIGHTNESSUP FIND NEXTSONG SENDFILE CALC FORWARD OPEN SETUP CAMERA FRONT PASTE SHOP CANCEL HANGUEL PAUSE SLEEP CHAT HANJA PAUSECD SOUND CLOSE HELP PHONE SPORT CLOSECD HOMEPAGE PLAY STOP COFFEE HP PLAYCD STOPCD COMPOSE ISO PLAYPAUSE SUSPEND COMPUTER KBDILLUMDOWN POWER SWITCHVIDEOMODE CONFIG KBDILLUMTOGGLE PREVIOUSSONG UNDO CONNECT KBDILLUMUP PRINT VOLUMEDOWN COPY KPCOMMA PROG1 VOLUMEUP CUT KPEQUAL PROG2 WAKEUP CYCLEWINDOWS KPLEFTPAREN PROG3 WWW DELETEFILE KPPLUSMINUS PROG4 XFER DIRECTION KPRIGHTPAREN PROPS YEN EDIT LEFTMETA QUESTION EJECTCD MACRO RECORD
You can find the correct keycodes from here: http://keytouch.sourceforge.net/keytouch_editor/node7.html
- Default action
It is important to realize that the default action for a key, is not the action you want to use for this key, but one that corresponds to the function of the key. The default action can be a program or a plugin. If it is a program, just ﬁll in the name of the program. If it is a plugin type ”plugin” (without the quotes) instead. Then ﬁll in the name of the plugin. To get a list of all available plugins, run keyTouch and go to the ”Preferences” part. Select the plugin and click the ”Information...” button to get a list of the functions of the selected plugin. After entering the plugins name in keytouch-editor, ﬁll in the function name. Note that the name and function you ﬁll in are case sensitive.
- When you entered the information, the program asks again to press an extra function key. If there are no more extra function keys, just press enter to write the output ﬁle and terminate the program.
- After you made the file and tested it, it would be a good idea to send it to the author of keytouch so he can include it in the next release.
(You know there's a missing @ because of spam bots ;))
- We now need to run keytouch
- What to do...
- When you see the list of keyboards select import and find where you put the keyboard config file you just made.
- Now you should see your keyboard module and manufactor. Select it and click ok.
- Now you get to the keytouch configuration theme. I think this is pretty self explanatory.
Starting the keytouch deamon
- You should start the keytouch deamon at boottime (add
keytouchto the deamons array in
- You have to load keytouchd together with X. There is a script /etc/X11/Xsession which runs all daemons located in /etc/X11/Xsession.d/ including the keytouchd.
- You can add /etc/X11/Xsession into your ~/.xinitrc if you log in from console
- If you, however, use KDM as your login manager .xinitrc will not be parsed. There is a file /opt/kde/share/config/kdm/Xstartup which is parsed when KDM starts so you can add there instead and it will work for all users.
# vi /opt/kde/share/config/kdm/Xstartup
and add at the end of the file:
- You can add
keytouchdto your session list of your DE. (Gnome, Kde, Xfce-svn)
- You can add
For more information look at the programs's homepage: http://keytouch.sourceforge.net/doc.html