Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Aug 2013 07:08:46 +0200
From:      Polytropon <freebsd@edvax.de>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Assign program call to a key
Message-ID:  <20130803070846.8cabc010.freebsd@edvax.de>

next in thread | raw e-mail | index | archive | help
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.



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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130803070846.8cabc010.freebsd>