home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
me34src.zip
/
me3
/
mutt
/
package
/
xterm.mut
< prev
Wrap
Text File
|
1995-01-14
|
939b
|
43 lines
;; xterm.mut : intercept and map function keys for VT100 like terminals
;; C Durland Public Domain
(include me.mh)
(defun
MAIN { (keymap-special GLOBAL-KEYMAP) }
keymap-special (int keymap) { (bind-key keymap "VT-sofkeys" "^[[") }
VT-sofkeys ; soft keys: ESC [ ...
{
(string c)
(exe-key
(switch (getchar)
"A" 0x843 ; Up arrow
"B" 0x844 ; Down arrow
"D" 0x846 ; Left arrow
"C" 0x845 ; Right arrow
"$" 0x84A ; Next
"" 0x841 ; Home
"4" { (getchar) 0x84E } ; select: ESC [ 4 ~
"5" { (getchar) 0x849 } ; Prev: ESC [ 5 ~
"6" { (getchar) 0x84A } ; Next: ESC [ 6 ~
"1" ; Functions keys: ESC [ 1 x ~
{
(c (getchar))(getchar)
(switch c
"1" 0x831 ; f1
"2" 0x832 ; f2
"3" 0x833 ; f3
"4" 0x834 ; f4
"5" 0x835 ; f5
"7" 0x836 ; f6
"8" 0x837 ; f7
"9" 0x838 ; f8
)
}
default { (msg "Unknown key")(done) }
)
)
}
)