[comp.emacs] Binding keys

ajs@prg.ox.ac.uk (Adolfo Socorro) (02/14/91)

Can anybody tell me how to bind the keys of my Sun workstation? I've done this
on other machines, but on the Suns I get some strange behaviour. I'm
especially interested in the R1..R15 keys.

Thanks,
Adolfo

bush@ecs.ox.ac.uk (Mark Bush) (02/15/91)

In article <1278@culhua.prg.ox.ac.uk> ajs@prg.ox.ac.uk (Adolfo Socorro) writes:
>Can anybody tell me how to bind the keys of my Sun workstation? I've done this
>on other machines, but on the Suns I get some strange behaviour. I'm
>especially interested in the R1..R15 keys.

I use emacs as little as possible (I much prefer Jove) but, when I
do, I have the following in my .emacs file.

The bindings for moving up/down one line and backwards/forwards one
character should work on most terminals (not just Suns).  From this, it
should be fairly obvious how to proceed for the other function keys.

Mark

----------------------------------
(global-unset-key "\M-[")
(define-key global-map "\M-[A" 'previous-line)   ;; up-arrow (R8)
(define-key global-map "\M-[B" 'next-line)       ;; down-arrow (R14)
(define-key global-map "\M-[D" 'backward-char)   ;; left-arrow (R10)
(define-key global-map "\M-[C" 'forward-char)    ;; right-arrow (R12)
(define-key global-map "\M-OA" 'previous-line)   ;; R8
(define-key global-map "\M-OB" 'next-line)       ;; R14
(define-key global-map "\M-OD" 'backward-char)   ;; R10
(define-key global-map "\M-OC" 'forward-char)    ;; R12
(define-key global-map "\M-[215z" 'previous-line);; R8
(define-key global-map "\M-[221z" 'next-line)    ;; R14
(define-key global-map "\M-[217z" 'backward-char);; R10
(define-key global-map "\M-[219z" 'forward-char) ;; R12
(define-key global-map "\M-[222z" 'set-mark-command)  ;; R15
(define-key global-map "\M-[210z" 'undo)              ;; R3
(define-key global-map "\M-[211z" 'beginning-of-line) ;; R4
(define-key global-map "\M-[212z" 'end-of-line)       ;; R5
(define-key global-map "\M-[213z" 'other-window)      ;; R6
(define-key global-map "\M-[214z" 'backward-word)     ;; R7
(define-key global-map "\M-[216z" 'forward-word)      ;; R9
(define-key global-map "\M-[220z" 'find-file)         ;; R13
(define-key global-map "\M-[208z" 'beginning-of-buffer) ;; R1
(define-key global-map "\M-[209z" 'end-of-buffer)     ;; R2
(define-key global-map "\M-[218z" 'switch-to-buffer)  ;; R11

khera@thneed.cs.duke.edu (Vick Khera) (02/15/91)

In article <1278@culhua.prg.ox.ac.uk> ajs@prg.ox.ac.uk (Adolfo Socorro) writes:

   Can anybody tell me how to bind the keys of my Sun workstation?
   I've done this on other machines, but on the Suns I get some
   strange behaviour. I'm especially interested in the R1..R15 keys.

the following works quite well for me.  it can be extended to include
other keys from the keypad as well.


; set up some Sun key bindings (for use under X)
(setq window-setup-hook
      (function
       (lambda ()
	 (defvar sun-raw-map (make-sparse-keymap)
	   "*Keymap for ESC-[ encoded keyboard")
	 (define-key sun-raw-map "214z" 'beginning-of-buffer)    ; R7
	 (define-key sun-raw-map "216z" 'scroll-down)            ; R9
	 (define-key sun-raw-map "218z" 'recenter)               ; R11
	 (define-key sun-raw-map "220z" 'end-of-buffer)          ; R13
	 (define-key sun-raw-map "222z" 'scroll-up)              ; R15
	 (define-key esc-map "[" sun-raw-map)
	 )))

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vick Khera, Gradual Student/Systems Guy   Department of Computer Science
ARPA:   khera@cs.duke.edu                 Duke University
UUCP:   ...!mcnc!duke!khera               Durham, NC 27706     (919) 660-6528

monnie@mike.BELLCORE.COM (Monnie Shambayati) (02/22/91)

Now that we are on this subject, a friend of mine uses IBM RS/6000
Workstation and he was wondering if anyone had the mappings for an IBM
keyboard.  (Is the mapping the same for IBM PC vs IBM Workstation?)

			Thanks in Advance. -- Monnie

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Please use one of the addresses below to reply.  +  Together we stand,       +
+       					  +  Divided we fall!         +
+             ....bellcore!cheetah!monnie or      +     	              +
+             cheetah!monnie@thumper.bellcore.com +	   Pink Floyd         +
+       					  +			      +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++