home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / me34src.zip / me3 / mutt / package / xterm.mut < prev   
Text File  |  1995-01-14  |  939b  |  43 lines

  1.   ;; xterm.mut : intercept and map function keys for VT100 like terminals
  2.   ;; C Durland    Public Domain
  3.  
  4. (include me.mh)
  5.  
  6. (defun
  7.   MAIN { (keymap-special GLOBAL-KEYMAP) }
  8.   keymap-special (int keymap) { (bind-key keymap "VT-sofkeys" "^[[") }
  9.   VT-sofkeys    ; soft keys: ESC [ ...
  10.   {
  11.     (string c)
  12.  
  13.     (exe-key
  14.       (switch (getchar)
  15.     "A" 0x843    ; Up arrow
  16.     "B" 0x844    ; Down arrow
  17.     "D" 0x846    ; Left arrow
  18.     "C" 0x845    ; Right arrow
  19.     "$" 0x84A    ; Next
  20.     ""  0x841    ; Home
  21.     "4" { (getchar) 0x84E }    ; select: ESC [ 4 ~
  22.     "5" { (getchar) 0x849 }    ; Prev:   ESC [ 5 ~
  23.     "6" { (getchar) 0x84A }    ; Next:   ESC [ 6 ~
  24.     "1"        ; Functions keys: ESC [ 1 x ~
  25.       {
  26.         (c (getchar))(getchar)
  27.         (switch c
  28.           "1" 0x831        ; f1
  29.           "2" 0x832        ; f2
  30.           "3" 0x833        ; f3
  31.           "4" 0x834        ; f4
  32.           "5" 0x835        ; f5
  33.           "7" 0x836        ; f6
  34.           "8" 0x837        ; f7
  35.           "9" 0x838        ; f8
  36.         )
  37.       }
  38.     default { (msg "Unknown key")(done) }
  39.       )
  40.     )
  41.   }
  42. )
  43.