Article View: gnu.epoch.misc
Article #55Re: sun-4 function key binding ?
From: Scott Brim
Date: Wed, 29 Jul 1992 20:09
Date: Wed, 29 Jul 1992 20:09
47 lines
2689 bytes
2689 bytes
I like Alan Carroll's approach (which used to be in the contrib stuff;
I'm not sure if it's there anymore. Anyway ... ). The main advantage
for me is that it does completely away with the leading ESC in the
function key sequences. This means you can end a search automatically
when you press a function key, instead of getting an accidental "276z"
inserted in your buffer (the other way to do it is to end the search
termination character, but this is more elegant). Here's the philosophy
and some samples; check rebind-key and such for more information. I
suppose I could send all my key bindings if you like....
;; Function key mapping is to start with \C-^ as the first character.
;; This stuff here prevents the function keys from screwing up during search
;; and other minibuffer activities, as it does when for the default settings,
;; which have ESC as the first char.
;;
;; Conventions:
;; Rebound keys start with control-^.
;; Keypad keys are "k" followed by the keypad symbol.
;; 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.
;; letter use "_" followed by the letter.
;;
;; Modifiers are "S" for shift, "C" for control, "M" for meta, and "A" for alt.
(rebind-key "L3" 0 "\C-^l3")
(rebind-key "L3" 'shift "\C-^Sl3")
(rebind-key "L3" 'control "\C-^Cl3")
(rebind-key "L3" 'meta "\C-^Ml3")
(global-set-key "\C-^l3" (definteractive
(list-buffers)
(pop-to-buffer "*Buffer List*"))) ; L3
By the way, at least when using Openwin ...
;;;
;;; Apparently X can't distinguish L1 from F11 or L2 from F12.
;;; We do an xmodmap -e 'keycode 8 = Select' and 'keycode 10 = Execute'
;;; and then the following bindings to recover.
;;;
(rebind-key "Select" 0 "\C-^l1")
(rebind-key "Execute" 0 "\C-^l2")
(rebind-key "Select" 'control "\C-^Cl1")
(rebind-key "Execute" 'control "\C-^Cl2")
(rebind-key "Select" 'meta "\C-^Ml1")
(rebind-key "Execute" 'meta "\C-^Ml2")
Technical Details
Message-ID:
<SWB.92Jul29150959@falcon.cit.cornell.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!newsstand.cit.cornell.edu!newsstand.cit.cornell.edu!swbReferences:
<1992Jul28.173529.23497@cbfsb.cb.att.com> <9207282126.AA11427@se33.wg2.waii.com>Show Full Headers
Complete Article Headers
Newsgroups: gnu.epoch.misc Path: arc1-ca.pugleaf.net!sparky!uunet!newsstand.cit.cornell.edu!newsstand.cit.cornell.edu!swb From: Scott Brim <swb@nr-tech.cit.cornell.edu> Subject: Re: sun-4 function key binding ? In-Reply-To: jct%se33@se01.wg2.waii.COM's message of Tue, 28 Jul 1992 21: 26:32 GMT Message-ID: <SWB.92Jul29150959@falcon.cit.cornell.edu> Sender: news@mail.cornell.edu Nntp-Posting-Host: falcon.cit.cornell.edu Nntp-Posting-User: @cornell.edu Organization: Cornell University, Ithaca, New York, USA References: <1992Jul28.173529.23497@cbfsb.cb.att.com> <9207282126.AA11427@se33.wg2.waii.com> Distribution: gnu Date: Wed, 29 Jul 1992 20:09:59 GMT Lines: 47