From: eric@joker.mil.ufl.edu (Eric M. Schwartz)
Newsgroups: comp.sys.sgi,comp.emacs
Subject: Re: keyboard map for emacs on 4D/20 sgi
Date: 11 Apr 92 15:47:08 GMT
Article-I.D.: eng.1992Apr11.154708.3342
Followup-To: eric@mil.ufl.edu
Organization: Machine Intelligence Laboratory, University of Florida


The below file should be put in ---/emacs/lisp/term if you would like
keyboard map for emacs on 4D/20 SiliconGraphics.  It works well.  Thanks
to Helmut Biesenbach for the file.

----------------------------- cut here -----------------------------------

;; Map Iris/4d function key escape sequences
;; into the standard slots in function-keymap.

(define-key global-map "\C-H" 'backward-delete-char-untabify)

; the following definitions are for Iris/4d terminal
;=====================================================

(defvar s-prefix-map (make-sparse-keymap)
   "Keymap for terminal-dependent keys.")
(define-key global-map "\e[" 's-prefix-command)
(fset 's-prefix-command s-prefix-map)

; die tasten f9-f12 sowie 0-Ins und .-Del senden <esc>O und dann einen
; buchstaben: f9 P  f10 Q   f11 R   f12 S  0-Ins p  .-Del n
; daher sind die definitionen unten falsch. da ich nicht weiss,
; wie man sie aendert funtionieren die tasten nicht.
; helmut biesenbach 23.12.88.

(defvar o-prefix-map (make-sparse-keymap)
   "Keymap for terminal-dependent keys.")
(define-key global-map "\eO" 'o-prefix-command)
(fset 'o-prefix-command o-prefix-map)

;;---------- unshifted keys --------------------------------------------
(define-key s-prefix-map "139q" 'overwrite-mode)        ; Insert
(define-key s-prefix-map "H"    'beginning-of-buffer)   ; Home
(define-key s-prefix-map "146q" 'end-of-buffer)         ; End
(define-key s-prefix-map "150q" 'scroll-down)           ; Pg Up
(define-key s-prefix-map "154q" 'scroll-up)             ; Pg Dn
(define-key s-prefix-map "A"    'previous-line)         ; up arrow
(define-key s-prefix-map "B"    'next-line)             ; down arrow
(define-key s-prefix-map "C"    'forward-char)          ; right arrow
(define-key s-prefix-map "D"    'backward-char)         ; left-char

;;---------- shifted keys ----------------------------------------------
(define-key s-prefix-map "158q" 'beginning-of-line)     ; left arrow
(define-key s-prefix-map "167q" 'end-of-line)           ; right arrow


;;---------- misc. commands --------------------------------------------
(define-key s-prefix-map "142q" 'kill-line)             ; ctrl. Delete

;;---------- unshifted numeric block -----------------------------------
(define-key o-prefix-map "y"    'scroll-down)           ; 9-Pg Up
(define-key o-prefix-map "x"    'previous-line)         ; 8-up arrow
(define-key o-prefix-map "w"    'beginning-of-buffer)   ; 7-Home
(define-key o-prefix-map "v"    'forward-char)          ; 6-right arrow
(define-key o-prefix-map "t"    'backward-char)         ; 4-left-char
(define-key o-prefix-map "s"    'scroll-up)             ; 3-Pg Dn
(define-key o-prefix-map "r"    'next-line)             ; 2-down arrow
(define-key o-prefix-map "q"    'end-of-buffer)         ; 1-End
(define-key o-prefix-map "p"    'overwrite-mode)        ; 0-Ins
(define-key o-prefix-map "n"    'delete-char)           ; .-Del

;;---------- unshifted function keys -----------------------------------
(define-key s-prefix-map "001q" 'set-mark-command)      ; F1
(define-key s-prefix-map "002q" 'kill-region)           ; F2
(define-key s-prefix-map "003q" 'yank)                  ; F3
(define-key s-prefix-map "004q" 'overwrite-mode)        ; F4
(define-key s-prefix-map "005q" 'insert-file)           ; F5
(define-key s-prefix-map "006q" 'find-file)             ; F6
(define-key s-prefix-map "007q" 'scroll-down)           ; F7
(define-key s-prefix-map "008q" 'scroll-up)             ; F8
(define-key s-prefix-map "009q" 'save-buffer)           ; F9
(define-key s-prefix-map "010q" 'save-buffers-kill-emacs) ; F10
(define-key s-prefix-map "011q" 'delete-char)           ; F11
(define-key s-prefix-map "012q" 'kill-line)             ; F12
(define-key o-prefix-map "P"    'save-buffer)           ; F9
(define-key o-prefix-map "Q"    'save-buffers-kill-emacs) ; F10
(define-key o-prefix-map "R"    'delete-char)           ; F11
(define-key o-prefix-map "S"    'kill-line)             ; F12


;;---------- shifted function keys -------------------------------------
(define-key s-prefix-map "013q" 'help-for-help)           ; shift F1
(define-key s-prefix-map "014q" 'kill-region)             ; shift F2
(define-key s-prefix-map "016q" 'save-buffers-kill-emacs) ; shift F4


; reset wsh key bindings

(send-string-to-terminal "\")     ; f3
(send-string-to-terminal "\")     ; f4
(send-string-to-terminal "\")     ; home
(send-string-to-terminal "\")     ; page-up
(send-string-to-terminal "\")     ; end
(send-string-to-terminal "\")     ; page-down


; end of "iris" terminal-type.
;=======================================================================


-------------------------------- end --------------------------------

Some of the function keys have also special meaning (the lisp command
tells what)

---
Eric M. Schwartz
Machine Intelligence Laboratory
University of Florida
eric@mil.ufl.edu