Article View: gnu.epoch.misc
Article #1796Re: mailing list .. etc
From: pms
Date: Wed, 18 Sep 1991 17:03
Date: Wed, 18 Sep 1991 17:03
211 lines
7893 bytes
7893 bytes
re:
>
> I am using the epoch program on a DECstation 3100 and find it
...
> facility that has occupied many (~15 or so) hours of my time. It is
> possible with Emacs or epoch to assign functions to the escape
> sequences of the keys from the keyboard and I prefer to do so for the
> heavily used functions. My difficulty is that I cannot get the keys:
>
> Prev Screen
> Next Screen
> Remove
> PF1-PF4
I use most of those keys in epoch on a DECstation 5000 (and occasionally
a 3100). The trick is to turn off escape mapping for the function
keys. Below is what I use to map Prev Screen (called "Prior")
and Next Screen (called "Next"), plus the the keypad function
keys KP_F1 through KP_F4.
Pat Sherry
pms@arbortext.com
-------------------
;; function keymapping based on Alan Carroll's contrib/amc.el
;;
;; Conventions:
;; Rebound keys start with control-\. (was control-^ in amc version)
;; Keypad keys are "k" followed by the keypad symbol.
;; kp_f1 is "kA", kp_f2 is "kB", kp_f3 is "kC", kp_f4 is "kD".
;; Functions keys are the function letter ("r","l", or "f") followed by the
;; number mod 10. The letter is uppercase if the function number is >9.
;;
;; Modifiers are "S" for shift, "C" for control, "M" for meta, and "A" for alt.
;; special keys
(setq epoch::function-key-mapping nil) ;turn off ESC mapping for function keys
;;; Sun keyboard specials
(rebind-key "Help" 0 "\C-h")
(rebind-key "R6" 0 "\C-\\r6")
;;; keypad bindings
(rebind-key "KP_Multiply" 0 "\C-\\k*")
(rebind-key "KP_Subtract" 0 "\C-\\k-")
(rebind-key "KP_Subtract" 0 "\C-\\k.")
(rebind-key "KP_Add" 0 "\C-\\k+")
(rebind-key "KP_F1" 0 "\C-\\kA")
(rebind-key "KP_F1" 'meta "\C-\\MkA")
(rebind-key "KP_F2" 0 "\C-\\kB")
(rebind-key "KP_F2" 'meta "\C-\\MkB")
(rebind-key "KP_F3" 0 "\C-\\kC")
(rebind-key "KP_F3" 'meta "\C-\\MkC")
(rebind-key "KP_F4" 0 "\C-\\kD")
(rebind-key "KP_F4" 'meta "\C-\\MkD")
;;; General bindings
;;; Insert
(rebind-key "Insert" 0 "\C-\\k0")
(rebind-key "Insert" 'meta "\C-\\Mk0")
;;; Find
(rebind-key "Find" 0 "\C-\\kf")
(rebind-key "Find" 'shift "\C-\\Skf")
(rebind-key "Find" 'meta "\C-\\Mkf")
;;; Home
(rebind-key "Home" 0 "\C-\\k7")
(rebind-key "R7" 0 "\C-\\k7")
(rebind-key "Home" 'shift "\C-\\Sk7")
(rebind-key "R7" 'shift "\C-\\Sk7")
(rebind-key "KP_7" 'shift "\C-\\Sk7")
(rebind-key "Home" 'control "\C-\\Ck7")
(rebind-key "R7" 'control "\C-\\Ck7")
;;; Up arrow
(rebind-key "Up" 0 "\C-\\k8")
(rebind-key "R8" 'shift "\C-\\Sk8")
(rebind-key "Up" 'shift "\C-\\Sk8")
(rebind-key "KP_8" 'shift "\C-\\Sk8")
(rebind-key "Up" 'control "\C-\\Ck8")
(rebind-key "Up" 'meta "\C-\\Mk8")
;;; Page Up
(rebind-key "Prior" 0 "\C-\\k9")
(rebind-key "R9" 0 "\C-\\k9")
(rebind-key "Prior" 'shift "\C-\\Sk9")
(rebind-key "R9" 'shift "\C-\\Sk9")
(rebind-key "KP_9" 'shift "\C-\\Sk9")
(rebind-key "Prior" 'control "\C-\\Ck9")
(rebind-key "R9" 'control "\C-\\Ck9")
(rebind-key "Prior" 'meta "\C-\\Mk9")
(rebind-key "R9" 'meta "\C-\\Mk9")
;;; Left arrow
(rebind-key "Left" 0 "\C-\\k4")
(rebind-key "R10" 'shift "\C-\\Sk4")
(rebind-key "Left" 'shift "\C-\\Sk4")
(rebind-key "KP_4" 'shift "\C-\\Sk4")
(rebind-key "Left" 'meta "\C-\\Mk4")
(rebind-key "Left" 'control "\C-\\Ck4")
;;; keypad center
(rebind-key "R11" 0 "\C-\\k5")
(rebind-key "KP_5" 0 "\C-\\k5")
(rebind-key "R11" 'control "\C-\\Ck5")
(rebind-key "KP_5" 'control "\C-\\Ck5")
;;; right arrow
(rebind-key "Right" 0 "\C-\\k6")
(rebind-key "R12" 'shift "\C-\\Sk6")
(rebind-key "Right" 'shift "\C-\\Sk6")
(rebind-key "KP_6" 'shift "\C-\\Sk6")
(rebind-key "Right" 'control "\C-\\Ck6")
(rebind-key "Right" 'meta "\C-\\Mk6")
;;; end
(rebind-key "End" 0 "\C-\\k1")
(rebind-key "R13" 0 "\C-\\k1")
(rebind-key "R13" 'shift "\C-\\Sk1")
(rebind-key "KP_1" 'shift "\C-\\Sk1")
(rebind-key "End" 'control "\C-\\Ck1")
(rebind-key "R13" 'control "\C-\\Ck1")
;;; Down arrow
(rebind-key "Down" 0 "\C-\\k2")
(rebind-key "R14" 'shift "\C-\\Sk2")
(rebind-key "Down" 'shift "\C-\\Sk2")
(rebind-key "KP_2" 'shift "\C-\\Sk2")
(rebind-key "Down" 'control "\C-\\Ck2")
(rebind-key "Down" 'meta "\C-\\Mk2")
;;; Page Down
(rebind-key "R15" 0 "\C-\\k3")
(rebind-key "Next" 0 "\C-\\k3")
(rebind-key "R15" 'shift "\C-\\Sk3")
(rebind-key "Next" 'shift "\C-\\Sk3")
(rebind-key "KP_3" 'shift "\C-\\Sk3")
(rebind-key "Next" 'control "\C-\\Ck3")
(rebind-key "R15" 'control "\C-\\Ck3")
(rebind-key "Next" 'meta "\C-\\Mk3")
(rebind-key "R15" 'meta "\C-\\Mk3")
;;; -------------------------------------------------------------------------
;;; Now, the bindings to function
;;;
(global-set-key "\C-\\r6" 'undo) ; keypad * on new suns
(global-set-key "\C-\\k*" 'undo) ; keypad * on '386
(global-set-key "\C-\\k0" 'yank) ; insert
(global-set-key "\C-\\Mk0" 'yank-pop) ; Meta-insert
;; Normal cursor keys move characters and lines
(global-set-key "\C-\\k8" 'previous-line) ; up arrow
(global-set-key "\C-\\k2" 'next-line) ; down arrow
(global-set-key "\C-\\k4" 'backward-char) ; left arrow
(global-set-key "\C-\\k6" 'forward-char) ; right arrow
;; Shifted horizontal goes words
(global-set-key "\C-\\Sk6" 'forward-word) ; shift right arrow
(global-set-key "\C-\\Sk4" 'backward-word) ; shift left arrow
(global-set-key "\C-\\Sk8" (definteractive (scroll-down 1))) ; shift up arrow
(global-set-key "\C-\\Sk2" (definteractive (scroll-up 1))) ; shift down arrow
;; control page switches screens
(global-set-key "\C-\\Ck9"
(definteractive (select-screen (raise-screen (next-screen))))
)
;control page-up
(global-set-key "\C-\\Ck3"
(definteractive (select-screen (raise-screen (prev-screen))))
)
;control page-down
(global-set-key "\C-\\Ck8" (definteractive (select-window (next-window))))
;control up arrow
(global-set-key "\C-\\Ck2" (definteractive (select-window (previous-window))))
;control down arrow
(global-set-key "\C-\\Sk9" (definteractive (raise-screen))) ;shift page-up
(global-set-key "\C-\\Sk3" (definteractive (lower-screen))) ;shift page-down
;;;
(global-set-key "\C-\\k7" 'beginning-of-line) ; Home
(global-set-key "\C-\\k5" 'recenter) ; Center
(global-set-key "\C-\\k1" 'end-of-line) ; End
(global-set-key "\C-\\Ck7" 'beginning-of-buffer) ; control Home
(global-set-key "\C-\\Ck1" 'end-of-buffer) ; control End
(global-set-key "\C-\\Ck5" 'exchange-point-and-mark) ; control center
(global-set-key "\C-\\C=" 'split-window-vertically) ;control =
(global-set-key "\C-\\C-" 'delete-other-windows) ;control -
(global-set-key "\C-\\k9" 'scroll-down) ; Page Up
(global-set-key "\C-\\k3" 'scroll-up) ; Page Down
;; Find key
(global-set-key "\C-\\kf" 'search-forward)
(global-set-key "\C-\\Skf" 'search-backward)
(global-set-key "\C-\\Mkf" 're-search-forward)
;; Keypad function keys
(global-set-key "\C-\\kA" 'replace-string) ; KP_F1
(global-set-key "\C-\\MkA" 'replace-regexp) ; Meta-KP_F1
(global-set-key "\C-\\kB" 'revert-buffer) ; KP_F2
(global-set-key "\C-\\kC" 'print-buffer) ; KP_F3
(global-set-key "\C-\\MkC" 'print-region) ; Meta-KP_F3
(global-set-key "\C-\\kD" 'insert-file) ; KP_F4
(global-set-key "\C-\\MkD" 'write-file) ; Meta-KP_F4
Technical Details
Message-ID:
<9109190104.AA07296@bronze.arbortext.com>Path:
arc1-ca.pugleaf.net!gmdzi!unido!unidui!math.fu-berlin.de!ira.uka.de!yale.edu!qt.cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!arbortext.com!pmsReferences:
<9109182330.AA13604@bubba.physics.lsa.umich.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc7ee,3a7f1cc9ceeb943a X-Google-Attributes: gidfc7ee,public X-Google-ArrivalTime: 1991-09-19 05:29:00 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!unidui!math.fu-berlin.de!ira.uka.de!yale.edu!qt.cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!arbortext.com!pms From: pms@arbortext.com Newsgroups: gnu.epoch.misc Subject: Re: mailing list .. etc Message-ID: <9109190104.AA07296@bronze.arbortext.com> Date: 18 Sep 91 17:03:57 GMT References: <9109182330.AA13604@bubba.physics.lsa.umich.edu> Sender: daemon@cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 211