Assign program call to a key

Polytropon freebsd at
Sat Aug 3 05:08:57 UTC 2013

Is there a way to assign a predefined program call to a key
in X, _independently_ from the window manager or desktop
environment in use?

Currently I'm using the following approach:

In ~/.xmodmap, I define a symbol according to the keycode
I found out by using the "xev" program:

	keycode 140 = F27

This file is "activated" by the "xmodmap ~/.xmodmaprc"
command in ~/xinitrc (called via ~/xsession, "cascaded").

In WindowMaker's menu, I define a submenu "Functions" where
I put the program calls I want to assign to keys, then use
the "Capture" function and press the desired key. Now the
association is made.

Of course, this approach is _specific_ to WindowMaker!

I'm searching for a way to do this among different environments
in X without having to configure each one of them (or even being
disappointed because this feature is not implemented). My goal
is to make the volume keys of various laptops change the volume
via the "mixer" command. Those keys are nothing special, they
just send key codes. Similarly I want to use this with my Sun
Type 7 USB keyboard. But I'd also like to make use of additional
and "multimedia" keys on laptops that simply send key codes that
can be assigned key names.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list