Remap one key to two

Remap one key to two

Post by Martin Ste » Tue, 15 Feb 2005 01:46:19


Hi,

how can I achieve the following:

Pressing e.g. F10 leads X to believe that e.g. Alt+T have been pressed?

Background is that browsers go back and forward with the key combination
Alt+RtArrow and Alt+LtArrow key. Since I have two special keys I want to
remap them to F13 and F14 and this should act like Alt+RtArrow and
Alt+LtArrow being pressed simultaneously, resp.

Thanks in advance, Martin.
 
 
 

Remap one key to two

Post by Dances Wit » Tue, 15 Feb 2005 09:52:56

On Mon, 14 Feb 2005 00:46:19 +0100, Martin Stenzel staggered into the
Black Sun and said:

xbindkeys and xmacroplay. Like so:

# in ~/.xbindkeysrc
"~/bin/alt-t.sh &"
m:0x10 + c:76
# keycode 76, no modifiers, executes ~/bin/alt-t.sh
# you can see what m: line you need for a given key with xbindkeys -k
# end of xbindkeys modification

#!/bin/bash
echo -e "KeyStrPress Alt_L\nKeyStrPress t\nKeyStrRelease t\n\
KeyStrRelease Alt_L\n" | xmacroplay :0
# end of ~/bin/alt-t.sh

xbindkeys and its frontedn gtk-xbindkeys are on your distro CDs.
xmacroplay may not be, but http://www.yqcomputer.com/
source, which should be a quick and easy compile as long as the X
development libraries are installed.


Yeah, not an uncommon thing to want to do.


Why do you want to remap the special keys to F13 and F14? Just have
xbindkeys do it automatically. Note that you have to kill -HUP
xbindkeys after changing its config file, and it's a good idea to start
xbindkeys with .xinitrc or with ~/.kde/Autostart/ or whatever. The
program is very powerful; I don't think I could use my MS Natural Pro
keyboard well without it. HTH,

--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong
http://www.yqcomputer.com/ / Hire me!
-----------------------------/ http://www.yqcomputer.com/ ~mhgraham/resume