Here are a few simple steps to help you do that:
1) Find out what type of keyboard you have:
I don't have multimedia keys, but what I do have is what I thought of as a "104+3" keyboard: a pc104, with three extra keys at the top right: Power off, Sleep, Wake up.
I discovered that what I have is actually referred to as a "acpi" keyboard.
(more on this at the end of the post)
2) Set X to recognize it:
To enable such a keyboard all you need to do is go to Setup->Mouse/keyboard wizard->Advanced...
Then you select your keyboard ("acpi" in my case), press "apply" and the keys will be recognized.
3) Make the keys do something:
You will most likely want to set some key-bindings, for the keys to actually do something...
Say I want to use the "Power off" key to shut down.
There are two things I need to do:
A) Find the "name" Xorg gave the key.
Open the file /etc/X11/xkb/symbols/inet and look for your keyboard.
In my case I get:
Code: Select all
// ACPI Standard
partial alphanumeric_keys
xkb_symbols "acpi" {
key <I5E> { [ XF86PowerOff ] };
key <I5F> { [ XF86Standby ] };
key <I63> { [ XF86WakeUp ] };
};
So my key is "XF86PowerOff".
B) Set the keybinding
Open /root/.jwm/jwmrc-personal and go down to the key bindings part.
You want to set the key "XF86PowerOff" to shut down. In Puppy, shutting down is done with the script "wmpoweroff" (to find out something like that, just open /root/.jwmrc and search for "power off"...).
So you just need to add a binding that makes XF86PowerOff execute that script:
Code: Select all
<Key key="XF86PowerOff">exec:wmpoweroff</Key>
Sidenote: If you want to know what any of the normal function keys is named, you can look in /etc/X11/xkb/symbols/pc for your keyboard layout and open it.
The layout will probably be based on /etc/X11/xkb/symbols/pc/pc, with some keys changed, so you might want to look at that one, too.
Useful example: the Win keys are Super_R and Super_L, so making them circle through the open windows is just a matter of adding:
Code: Select all
<Key key="Super_R">next</Key>
<Key key="Super_L">next</Key>
Code: Select all
<Key key="Menu">root:3</Key>
If you can't find out your keyboard type:
The way I found out which keyboard I have was (except for looking in /etc/X11/xkb/symbols/inet for a keyboard that has only three special buttons, matching mine...) by checking the keycodes.
Here's how I did it (there is some simple GUI for doing it, but I don't remember what it's called...):
Take the "showkeys" app (attached, just gunzip it) and put it somewhere like /usr/bin.
Now exit to the prompt (important: don't try running it from X or it might cause damage).
Now run it with the "-s" option.
When it is running, you just press a key and the hex codes generated will appear. Right them down next to the key name, for use later on.
If you are lazy (like me), you can just redirect the output to a file:
Just run
Code: Select all
showkey -s >showky-output
Note: you cannot just kill showkey -- it terminates on its own if you don't press any key for 10 seconds.
Ok, now that you're done with that, start X again and look at the showky-output file. In my case:
Code: Select all
0x9c
0xe0 0x5e 0xe0 0xde
0xe0 0x5f
0xe0 0xdf
0xe0 0x63 0xe0 0xe3
The second line corresponds to me pressing (0xe0 0x5e) and releasing (0xe0 0xde) my "Power off" key.
Next we have pressing and releasing the "Sleep" button. I must have delayed longer before leaving the "sleep" button, as releasing it is in a separate line.
You can see the pattern of how it is displayed:
- Each key generates codes when pressed and released.
- Special keys seem to be preceded by "0xe0"
What you are interested in will be the second part of each key press: 0x5e, 0x5f, 0x63.
Now, compare those codes with what you see in /etc/X11/xkb/symbols/inet:
Code: Select all
key <I5E> { [ XF86PowerOff ] };
key <I5F> { [ XF86Standby ] };
key <I63> { [ XF86WakeUp ] };
Now you just need to look through that file and find a keyboard that matches your buttons.