
Hi All, Is there anyway to bind a command to an F-key? For example, I use the command "fetchpop -r -p -a" to get my email. It would be nice just to be able to hit "F-x" to run this commmand. At the command line by the way, not in X-windows. TIA! JIM

Hi, On Sat, Jul 31, 1999 at 11:15 +0200, James (Jim) Hatridge wrote:
Is there anyway to bind a command to an F-key? For example, I use the command "fetchpop -r -p -a" to get my email. It would be nice just to be able to hit "F-x" to run this commmand. At the command line by the way, not in X-windows.
If you use the bash as your shell, you can add "\e[11~": "fetchpop -r -p -a\n" to your ~/.inputrc (this binds fetchpop... to F1). To find out which key code a key produces, press Ctrl-V and then the key at the bash prompt. If you try this with F1 you should get "^[[11~". Replace the "^[" with "\e". Ciao, Stefan

Hi Stefan! On Sat, 31 Jul 1999, Stefan Troeger wrote:
Hi,
On Sat, Jul 31, 1999 at 11:15 +0200, James (Jim) Hatridge wrote:
Is there anyway to bind a command to an F-key? For example, I use the command "fetchpop -r -p -a" to get my email. It would be nice just to be able to hit "F-x" to run this commmand. At the command line by the way, not in X-windows.
If you use the bash as your shell, you can add
"\e[11~": "fetchpop -r -p -a\n"
to your ~/.inputrc (this binds fetchpop... to F1). To find out which key code a key produces, press Ctrl-V and then the key at the bash prompt. If you try this with F1 you should get "^[[11~". Replace the "^[" with "\e".
This is excellent, just what I also wanted to know. Saved for future reference. Sean -- Sysop and Webmaster of TCOB1 | Fidonet: 2:252/300 2:252/0 http://212.19.67.58 | Free Fidonet Feeds available telnet://212.19.67.58 2300 | Linux User: #124682 ICQ: 679813 ftp://212.19.67.58 | irc: thecivvie on irc.sysopnet.org Powered by SuSe Linux 6.0 and a 128k Tele2 connection Soon to be the father of TWINS PHORUMS online: http://212.19.67.58/phorum/

On Sat, 31 Jul 1999, Stefan Troeger wrote:
Hi, If you use the bash as your shell, you can add
"\e[11~": "fetchpop -r -p -a\n"
to your ~/.inputrc (this binds fetchpop... to F1). To find out which key code a key produces, press Ctrl-V and then the key at the bash prompt. If you try this with F1 you should get "^[[11~". Replace the "^[" with "\e".
HI Stefan et al!, Thanks this was what I was looking for. A couple of notes about this. First in SuSE you'll find the inputrc file in /etc. If you don't have it in your /~home files like me. I just copied it to my /~home and changed it to add the command I wanted. The next question is I have a win98 keyboard. It has two windows keys and 3 buttons. None of these give anything when I use the Ctrl-V. Any idea how to get them to work? Thanks! JIM

Hi, On Sun, Aug 01, 1999 at 16:36 +0200, James (Jim) Hatridge wrote:
Thanks this was what I was looking for. A couple of notes about this. First in SuSE you'll find the inputrc file in /etc. If you don't have it in your /~home files like me. I just copied it to my /~home and changed it to add the command I wanted.
That's the case with most configuration files -- there's a global one in /etc and a personal one in ~/.
The next question is I have a win98 keyboard. It has two windows keys and 3 buttons. None of these give anything when I use the Ctrl-V. Any idea how to get them to work?
Yep. But it'll be a bit more complicated. First find out what keyboard layout you're using (look for `KEYTABLE' in /etc/rc.config). Let's assume it's KEYTABLE="de-latin1-nodeadkeys.map.gz" Find the directory where the file de-latin1-nodeadkeys.map.gz is stored (it's somewhere in a subdirectory of /usr/lib/kbd). cd to that dir and create a new file `my_keymap.map'. It should look somewhat like this: -------------------------------------------------------------> # <- this is a comment # Load my default keyboard layout include "de-latin1-nodeadkeys.map" # Assign keysyms (e. g. `F100') to keycodes (e. g. `125') for # the Windows keys keycode 125 = F100 keycode 126 = F101 keycode 127 = F102 # Assign some strings to the keysyms string F100 = "\033[100~" string F101 = "\033[101~" string F102 = "\033[101~" <------------------------------------------------------------- The keycodes I used in the above example might be different on your keyboard. Use `showkey' to find it out. I don't know if there are dedicated keysyms for the Windows keys. I haven't found any so I've used F100 onwards (these shouldn't be in use already unless you have a HUGE keyboard ;-) Same goes for the strings ("\033[100~", ...) I've used. If anyone is familiar with the naming conventions they follow, I'd be interested to learn them. To make sure you don't use a string that is already assigned to another key, do a dumpkeys --long-info |less and make sure the strings you want to use aren't in the list dumpkeys shows you. That's it. Now it's time to load the keymap (`loadkeys my_keymap.map') and test it. Ctrl-V + keypress should now create some output you can use in your ~/.inputrc. If there aren't any errors, do a gzip my_keymap.map and edit /etc/rc.config, replace the KEYTABLE="de-latin1-nodeadkeys.map.gz" with KEYTABLE="my_keymap.map.gz" Ciao, Stefan
participants (3)
-
hatridge@straubing.baynet.de
-
lists@tcob1.tele2.co.uk
-
stefan.troeger@wirtschaft.tu-chemnitz.de