Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
User Journal

Journal bittmann's Journal: How to add new events to new keys in RedHat 9.0 2

In my last entry (July 8), I noted that I needed to document how I added keybindings to the volume keys in RedHat 9.0.

First of all, it isn't as easy as it might be. There is documentation in RH9 under Preferences/Keyboard Shortcuts that indicates that there is an "Add a Custom Binding" function in the Gnome Keyboard Shortcuts tool. No, there isn't. So...it's harder than editing an "add" screen. But not TOO hard...

First of all, the keybindings must be put in place to map a keyboard scancode to an event. I added the following to /etc/X11/Xmodmap:

keycode 115 = F30
! Windows key
keycode 174 = F31
! Vol down
keycode 176 = F32
! Vol up
keycode 160 = F33
! Mute
keycode 137 = F34
! eject (busted!)
keycode 117 = F35
! Menu key

Note that the eject key doesn't seem to work well for me...need to get back to that.

So, now, when you press the Windows key, Xwindows will receive an F30.

Now, the obscure (but easy) part:

Go into System Tools/More System Tools/Configuration Editor (GConf)
Drill down to apps/metacity.

Step 1: Add a custom command to an unused entry.

Under keybinding_commands, I edited the following:

command_2 became aumix -v-5
command_3 became aumix -v+5
command_4 became aumix -v0
command_5 became gnome-terminal

I left out eject after I couldn't get the key to work. Will try again "later".

Step 2: Bind the new commands to the new keycodes

Under global_keybindings, I edited the following:

run_command_2 is set to F31
run_command_3 is set to F32
run_command_4 is set to F33
run_command_5 is set to F35

(I left the "windows" key unmapped...I keep bumping it! But I mapped gnome-terminal to the menu selector key (above F9), so pressing that key gives me a new terminal. Slick.)

Restart X, and now the volume keys work.

I have been cautioned that function keys above F35 may not work. I haven't tried it to see. YMMV.

This discussion has been archived. No new comments can be posted.

How to add new events to new keys in RedHat 9.0

Comments Filter:
  • xev is your friend - it will show you the keycodes, scan codes, and keysyms returned by pressing keys.

    Given the key codes, you can modify /etc/X11/Xmodmap to map the key codes to a key sym that can be hooked in X.

    You can also set up the lower level mapping using the /etc/X11/xkb files.
  • Yah...and mouse events, blah, blah, blah.

    Under RH9, editing xkb isn't the "preferred" method of doing your keybindings, 'cause that could throw off the gui configuration tool (gnome-keybinding-properties??) . Of course, the gui configuration tool isn't capable of actually adding new keymappings (regardless of what the help system says), but digging down in the low-level configuration tool (gconf-editor??) enables you to bypass that limitation. So, using the shipped editor instead of manually re-mapping t

Kleeneness is next to Godelness.

Working...