Difference between revisions of "Extra keyboard keys"

From ArchWiki
Jump to: navigation, search
(Alternative way (build it yourself): fixed the url. Also changed it to point to the CVS instead, since the link seems more "immutable", and is more logical.)
m (Alternative way (build it yourself): correction - "keytouch" -> "keytouch.daemon")
Line 7: Line 7:
  # pacman -S keytouch
  # pacman -S keytouch
===Alternative way (build it yourself)===
===Alternative way (build it yourself)===
* Download the keytouch PKGBUILD from [http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/system/keytouch/?cvsroot=AUR&only_with_tag=CURRENT here.]  Don't forget the files "keytouch" and "keytouch.desktop", they are under the sources list on aur.  Put these 2 files and the PKGBUILD in the same directory.
* Download the keytouch PKGBUILD from [http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/system/keytouch/?cvsroot=AUR&only_with_tag=CURRENT 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
* Run makepkg

Revision as of 13:38, 31 October 2006

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.


# 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 files. To find out which file belongs to your keyboard, run:

# keytouch-editor /dev/input/eventX mykeyboardconfig

Replace the X by a number. KeyTouch editor will first 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.

  • Keycode

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 file.

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
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 fill in the name of the program. If it is a plugin type ”plugin” (without the quotes) instead. Then fill 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, fill in the function name. Note that the name and function you fill 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 file 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.
marvinr users.sourceforge.net

(You know there's a missing @ because of spam bots ;))

Configure keytouch

  • We now need to run keytouch
  • What to do...
  1. When you see the list of keyboards select import and find where you put the keyboard config file you just made.
  2. Now you should see your keyboard module and manufactor. Select it and click ok.
  3. 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 keytouch to the deamons array in /etc/rc.conf)
  • 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 keytouchd to your session list of your DE. (Gnome, Kde, Xfce-svn)

Additional docs

For more information look at the programs's homepage: http://keytouch.sourceforge.net/doc.html