home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!sun-barr!news2me.EBay.Sun.COM!cronkite.Central.Sun.COM!texsun!digi!kgallagh
- From: kgallagh@digi.lonestar.org (Kevin Gallagher)
- Newsgroups: comp.sys.apollo
- Subject: Preserving bind-apollo-function-key when running under X
- Message-ID: <1992Dec18.202606.14879@digi.lonestar.org>
- Date: 18 Dec 92 20:26:06 GMT
- Organization: DSC Communications Corp, Plano, TX
- Lines: 398
-
- We have been using Leonard N Zubkoff's (lnz@lucid.com) Apollo customized
- versions of GNU Emacs on our Apollos for some time now (latest version we have
- installed is 18.57). A month ago I started using X. I quickly discovered
- that all my Apollo function key and keypad key bindings (the gray keys), no
- longer worked. These bindings were made in my .emacs file using Zubkoff's
- supplied function, bind-apollo-function-key, which is defined in
- /gnuemacs/etc/apollo.el.
-
- This meant, I first thought, that I would have to go through the painful
- process of figuring out how to bind emacs functions to the gray keys under X
- and then modify my .emacs file accordingly. After talking to others who had
- done this, I felt there had to be a better way, and there is!
-
- The attached file, x-apollo-keys.el, solves the problem. All Apollo keyboard
- gray key bindings made in your .emacs file, which work under the DM, will now
- work under X, as well. The same .emacs will work for both.
-
- All you have to do is place x-apollo-keys.el in your emacs load path and then
- add the following line to your .emacs file:
-
- (load "x-apollo-keys" nil t)
-
- BEFORE any call to bind-apollo-function-key in your .emacs file.
-
- That's it!
-
- ============================ CUT HERE ===========================
- ;;; File: x-apollo-keys.el, v 1.0
- ;;;
- ;;; ----------- --------------- - ---------------
- ;;; A p o l l o K e y b o a r d X B i n d i n g s
- ;;; ----------- --------------- - ---------------
- ;;;
- ;;; Copyright (C) 1992 Kevin Gallagher
- ;;;
- ;;; GNU Emacs is distributed in the hope that it will be useful, but
- ;;; WITHOUT ANY WARRANTY. No author or distributor accepts
- ;;; RESPONSIBILITY TO anyone for the consequences of using it or for
- ;;; whether it serves any particular purpose or works at all, unless
- ;;; he says so in writing. Refer to the GNU Emacs General Public
- ;;; License for full details.
- ;;;
- ;;; Send bug reports and suggestions for improvement to Kevin Gallagher
- ;;; (kgallagh@digi.lonestar.org).
- ;;;
- ;;; Everyone is granted permission to copy, modify and redistribute
- ;;; GNU Emacs, but only under the conditions described in the GNU
- ;;; Emacs General Public License. A copy of this license is supposed
- ;;; to have been given to you along with GNU Emacs so you can know
- ;;; your rights and responsibilities. It should be in a file named
- ;;; COPYING. Among other things, the Copyright notice and this notice
- ;;; must be preserved on all copies.
- ;;;
- ;;; ====================================================================
-
- ;; X rebindings for an Apollo keyboard.
- ;;
- ;; This file is for people who have have been using Leonard N Zubkoff's
- ;; (lnz@lucid.com) Apollo customized version of GNU Emacs under the
- ;; Display Manager (DM) window system and are in the process of moving
- ;; (or will be moving) to X.
- ;;
- ;; The first time you bring up GNU Emacs under X, you discover that
- ;; you have lost all your customized function key and keypad key
- ;; bindings that you (or you site admin) made using the supplied
- ;; function bind-apollo-function-key. This makes the migration to X
- ;; painful, as each user has to start over learning how to customize
- ;; the apollo function keys via x-rebind-key.
- ;;
- ;; If you use the rebindings in this file, MOST of your non-DM
- ;; specific function key bindings made with bind-apollo-function-key
- ;; will continue to work in an xterm window. (Support for upstroke
- ;; bindings on function keys is NOT provided, but control and shift
- ;; bindings are supported.)
- ;;
- ;; This file should work with GNU Emacs 18.55 and above. It has been
- ;; tested with GNU Emacs 18.55 and 18.57.
- ;;
- ;; Support is included for Control, Caps_Lock, and Shift modified
- ;; function key strokes. It treats the left and right shift keys as
- ;; the same. It does NOT add the bindings for the left and right Alt
- ;; keys found on the newer Apollo keyboards, however.
- ;;
- ;; NOTE: The function x-rebind-key appears to take only ONE modifier
- ;; key. This means that there is no way to tell emacs to
- ;; rebind control, alt, and shift modified function key strokes
- ;; when the Caps_Lock key has been toggled on. So control,
- ;; alt, and shift function key bindings don't work under X when
- ;; the Caps Lock key is toggled on, with the implementation of
- ;; x-rebind-key in 18.55 and 18.57 Apollo GNU Emacs. Perhaps
- ;; someone will generate a fix for this.
- ;;
- ;;
- ;; INSTALLATION: Place this file, x-apollo-key.el, in your emacs
- ;; load path. Then, in your .emacs file, which you
- ;; currently use when running GNU Emacs under DM, add
- ;; the following line BEFORE any invocation of
- ;; function bind-apollo-function-key:
- ;;
- ;; (load "x-apollo-keys" nil t)
- ;;
- ;; Now there is no need to make conditional
- ;; keybindings in your .emacs file based upon which
- ;; windowing system is in use. You get the
- ;; benefit of having all of the default DM function
- ;; key bindings made in emacs/etc/apollo.el and the
- ;; use of the non-DM related functions defined
- ;; therein.
- ;;
- ;; ========================================================================
-
- ;;
- ;; Key names are found in /usr/lib/X11/XKeysymDB and by executing
- ;;
- ;; xmodmap -pk
- ;;
- ;; at a shell prompt.
- ;;
- ;; Format:
- ;; (x-rebind-key KeySym ModifierSym NEWSTRING)
- ;; where
- ;; KeySym = String Representing Apollo X Keycap Name
- ;; ModifierSym = String Representing Apollo X Modifier Keycap Name
- ;; NEWSTRING = String to be Generated When KeySym is Pressed.
- ;;
- ;; Common modifiers to use with x-rebind-key:
- ;;
- ;; Shift_L Shift_R Control_L Control_R Caps_Lock
- ;;
-
-
- (if (string= window-system "x")
- (progn
- (load "../etc/apollo" nil t)
- (require 'x-mouse) ; Just to be helpful to the user.
-
- ;; Emacs, when run under DM, is hardwired, in the Apollo mods to
- ;; the Emacs source code, to have the Back Space key behave as a
- ;; Del key. The Del key is rebound here to behave the same way.
- ;;
- (x-rebind-key "BackSpace" nil "\C-?")
- (x-rebind-key "BackSpace" "Caps_Lock" "\C-?")
- (x-rebind-key "BackSpace" "Shift_R" "\C-?")
- (x-rebind-key "BackSpace" "Shift_L" "\C-?")
- (x-rebind-key "BackSpace" "Control_L" "\C-?")
-
- ;; Left Functions Keys
- (x-rebind-key "Select" nil "\C-^HA") ; Ins/Mark
- (x-rebind-key "Select" "Caps_Lock" "\C-^HA") ; Ins/Mark
- (x-rebind-key "Insert" "Shift_R" "\C-^IA") ; Ins/Mark
- (x-rebind-key "Insert" "Shift_L" "\C-^IA") ; Ins/Mark
- (x-rebind-key "Select" "Control_L" "\C-^JA") ; Ins/Mark
- (x-rebind-key "LineDel" nil "\C-^HB")
- (x-rebind-key "LineDel" "Caps_Lock" "\C-^HB")
- (x-rebind-key "LineDel" "Shift_R" "\C-^IB")
- (x-rebind-key "LineDel" "Shift_L" "\C-^IB")
- (x-rebind-key "LineDel" "Control_L" "\C-^JB")
- (x-rebind-key "CharDel" nil "\C-^HC")
- (x-rebind-key "CharDel" "Caps_Lock" "\C-^HC")
- (x-rebind-key "CharDel" "Shift_R" "\C-^IC")
- (x-rebind-key "CharDel" "Shift_L" "\C-^IC")
- (x-rebind-key "CharDel" "Control_L" "\C-^JC")
- (x-rebind-key "Copy" nil "\C-^HD")
- (x-rebind-key "Copy" "Caps_Lock" "\C-^HD")
- (x-rebind-key "Cut" "Shift_R" "\C-^ID")
- (x-rebind-key "Cut" "Shift_L" "\C-^ID")
- (x-rebind-key "Copy" "Control_L" "\C-^JD")
- (x-rebind-key "Paste" nil "\C-^HE")
- (x-rebind-key "Paste" "Caps_Lock" "\C-^HE")
- (x-rebind-key "Undo" "Shift_R" "\C-^IE")
- (x-rebind-key "Undo" "Shift_L" "\C-^IE")
- (x-rebind-key "Paste" "Control_L" "\C-^JE")
- (x-rebind-key "Grow" nil "\C-^HF")
- (x-rebind-key "Grow" "Caps_Lock" "\C-^HF")
- (x-rebind-key "Move" "Shift_R" "\C-^IF")
- (x-rebind-key "Move" "Shift_L" "\C-^IF")
- (x-rebind-key "Grow" "Control_L" "\C-^JF")
- (x-rebind-key "LeftBar" nil "\C-^HG")
- (x-rebind-key "LeftBar" "Caps_Lock" "\C-^HG")
- (x-rebind-key "LeftBar" "Shift_R" "\C-^IG")
- (x-rebind-key "LeftBar" "Shift_L" "\C-^IG")
- (x-rebind-key "LeftBar" "Control_L" "\C-^JG")
- (x-rebind-key "Cmd" nil "\C-^HH")
- (x-rebind-key "Cmd" "Caps_Lock" "\C-^HH")
- (x-rebind-key "Shell" "Shift_R" "\C-^IH")
- (x-rebind-key "Shell" "Shift_L" "\C-^IH")
- (x-rebind-key "Cmd" "Control_L" "\C-^JH")
- (x-rebind-key "RightBar" nil "\C-^HI")
- (x-rebind-key "RightBar" "Caps_Lock" "\C-^HI")
- (x-rebind-key "RightBar" "Shift_R" "\C-^II")
- (x-rebind-key "RightBar" "Shift_L" "\C-^II")
- (x-rebind-key "RightBar" "Control_L" "\C-^JI")
- (x-rebind-key "LeftBox" nil "\C-^HJ")
- (x-rebind-key "LeftBox" "Caps_Lock" "\C-^HJ")
- (x-rebind-key "LeftBox" "Shift_R" "\C-^IJ")
- (x-rebind-key "LeftBox" "Shift_L" "\C-^IJ")
- (x-rebind-key "LeftBox" "Control_L" "\C-^JJ")
- (x-rebind-key "Up" nil "\C-^HK")
- (x-rebind-key "Up" "Caps_Lock" "\C-^HK")
- (x-rebind-key "Up" "Shift_L" "\C-^IK")
- (x-rebind-key "Up" "Shift_R" "\C-^IK")
- (x-rebind-key "Up" "Control_L" "\C-^JK")
- (x-rebind-key "RightBox" nil "\C-^HL")
- (x-rebind-key "RightBox" "Caps_Lock" "\C-^HL")
- (x-rebind-key "RightBox" "Shift_R" "\C-^IL")
- (x-rebind-key "RightBox" "Shift_L" "\C-^IL")
- (x-rebind-key "RightBox" "Control_L" "\C-^JL")
- (x-rebind-key "Left" nil "\C-^HM")
- (x-rebind-key "Left" "Caps_Lock" "\C-^HM")
- (x-rebind-key "Left" "Shift_L" "\C-^IM")
- (x-rebind-key "Left" "Shift_R" "\C-^IM")
- (x-rebind-key "Left" "Control_L" "\C-^JM")
- (x-rebind-key "Next" nil "\C-^HN")
- (x-rebind-key "Next" "Caps_Lock" "\C-^HN")
- (x-rebind-key "Next" "Shift_R" "\C-^IN")
- (x-rebind-key "Next" "Shift_L" "\C-^IN")
- (x-rebind-key "Next" "Control_L" "\C-^JN")
- (x-rebind-key "Right" nil "\C-^HO")
- (x-rebind-key "Right" "Caps_Lock" "\C-^HO")
- (x-rebind-key "Right" "Shift_L" "\C-^IO")
- (x-rebind-key "Right" "Shift_R" "\C-^IO")
- (x-rebind-key "Right" "Control_L" "\C-^JO")
- (x-rebind-key "UpBox" nil "\C-^HP")
- (x-rebind-key "UpBox" "Caps_Lock" "\C-^HP")
- (x-rebind-key "UpBox" "Shift_R" "\C-^IP")
- (x-rebind-key "UpBox" "Shift_L" "\C-^IP")
- (x-rebind-key "UpBox" "Control_L" "\C-^JP")
- (x-rebind-key "Down" nil "\C-^HQ")
- (x-rebind-key "Down" "Caps_Lock" "\C-^HQ")
- (x-rebind-key "Down" "Shift_L" "\C-^IQ")
- (x-rebind-key "Down" "Shift_R" "\C-^IQ")
- (x-rebind-key "Down" "Control_L" "\C-^JQ")
- (x-rebind-key "DownBox" nil "\C-^HR")
- (x-rebind-key "DownBox" "Caps_Lock" "\C-^HR")
- (x-rebind-key "DownBox" "Shift_R" "\C-^IR")
- (x-rebind-key "DownBox" "Shift_L" "\C-^IR")
- (x-rebind-key "DownBox" "Control_L" "\C-^JR")
-
-
- ;; Right Function Keys
- (x-rebind-key "Redo" nil "\C-^H^") ; AGAIN
- (x-rebind-key "Redo" "Caps_Lock" "\C-^H^") ; AGAIN
- (x-rebind-key "Redo" "Shift_R" "\C-^I^") ; AGAIN
- (x-rebind-key "Redo" "Shift_L" "\C-^I^") ; AGAIN
- (x-rebind-key "Redo" "Control_L" "\C-^J^") ; AGAIN
- (x-rebind-key "Read" nil "\C-^H_")
- (x-rebind-key "Read" "Caps_Lock" "\C-^H_")
- (x-rebind-key "Read" "Shift_R" "\C-^I_")
- (x-rebind-key "Read" "Shift_L" "\C-^I_")
- (x-rebind-key "Read" "Control_L" "\C-^J_")
- (x-rebind-key "Edit" nil "\C-^H`")
- (x-rebind-key "Edit" "Caps_Lock" "\C-^H`")
- (x-rebind-key "Save" "Shift_R" "\C-^I`")
- (x-rebind-key "Save" "Shift_L" "\C-^I`")
- (x-rebind-key "Edit" "Control_L" "\C-^J`")
- (x-rebind-key "Exit" nil "\C-^Ha")
- (x-rebind-key "Exit" "Caps_Lock" "\C-^Ha")
- (x-rebind-key "Cancel" "Shift_L" "\C-^Ia"); Abort
- (x-rebind-key "Cancel" "Shift_R" "\C-^Ia"); Abort
- (x-rebind-key "Exit" "Control_L" "\C-^Ja")
- (x-rebind-key "Pause" nil "\C-^Hb"); Hold
- (x-rebind-key "Pause" "Caps_Lock" "\C-^Hb"); Hold
- (x-rebind-key "Help" "Shift_L" "\C-^Ib")
- (x-rebind-key "Help" "Shift_R" "\C-^Ib")
- (x-rebind-key "Pause" "Control_L" "\C-^Jb"); Hold
-
-
- ;; Keypad keys
- (x-rebind-key "KP_Enter" nil "\C-^Hq")
- (x-rebind-key "KP_Enter" "Caps_Lock" "\C-^Hq")
- (x-rebind-key "KP_Enter" "Shift_L" "\C-^Iq")
- (x-rebind-key "KP_Enter" "Shift_R" "\C-^Iq")
- (x-rebind-key "KP_Enter" "Control_L" "\C-^Jq")
- (x-rebind-key "KP_Subtract" nil "\C-^Hr")
- (x-rebind-key "KP_Subtract" "Caps_Lock" "\C-^Hr")
- (x-rebind-key "KP_Subtract" "Shift_L" "\C-^Ir")
- (x-rebind-key "KP_Subtract" "Shift_R" "\C-^Ir")
- (x-rebind-key "KP_Subtract" "Control_L" "\C-^Jr")
- (x-rebind-key "KP_Add" nil "\C-^Hs")
- (x-rebind-key "KP_Add" "Caps_Lock" "\C-^Hs")
- (x-rebind-key "KP_Add" "Shift_L" "\C-^Is")
- (x-rebind-key "KP_Add" "Shift_R" "\C-^Is")
- (x-rebind-key "KP_Add" "Control_L" "\C-^Js")
- (x-rebind-key "KP_Decimal" nil "\C-^Ht")
- (x-rebind-key "KP_Decimal" "Caps_Lock" "\C-^Ht")
- (x-rebind-key "KP_Decimal" "Shift_L" "\C-^It")
- (x-rebind-key "KP_Decimal" "Shift_R" "\C-^It")
- (x-rebind-key "KP_Decimal" "Control_L" "\C-^Jt")
- (x-rebind-key "KP_0" nil "\C-^Hc")
- (x-rebind-key "KP_0" "Caps_Lock" "\C-^Hc")
- (x-rebind-key "KP_0" "Shift_L" "\C-^Ic")
- (x-rebind-key "KP_0" "Shift_R" "\C-^Ic")
- (x-rebind-key "KP_0" "Control_L" "\C-^Jc")
- (x-rebind-key "KP_1" nil "\C-^Hd")
- (x-rebind-key "KP_1" "Caps_Lock" "\C-^Hd")
- (x-rebind-key "KP_0" "Shift_L" "\C-^Id")
- (x-rebind-key "KP_0" "Shift_R" "\C-^Id")
- (x-rebind-key "KP_1" "Control_L" "\C-^Jd")
- (x-rebind-key "KP_2" nil "\C-^He")
- (x-rebind-key "KP_2" "Caps_Lock" "\C-^He")
- (x-rebind-key "KP_2" "Shift_L" "\C-^Ie")
- (x-rebind-key "KP_2" "Shift_R" "\C-^Ie")
- (x-rebind-key "KP_2" "Control_L" "\C-^Je")
- (x-rebind-key "KP_3" nil "\C-^Hf")
- (x-rebind-key "KP_3" "Caps_Lock" "\C-^Hf")
- (x-rebind-key "KP_3" "Shift_L" "\C-^If")
- (x-rebind-key "KP_3" "Shift_R" "\C-^If")
- (x-rebind-key "KP_3" "Control_L" "\C-^Jf")
- (x-rebind-key "KP_4" nil "\C-^Hg")
- (x-rebind-key "KP_4" "Caps_Lock" "\C-^Hg")
- (x-rebind-key "KP_4" "Shift_L" "\C-^Ig")
- (x-rebind-key "KP_4" "Shift_R" "\C-^Ig")
- (x-rebind-key "KP_4" "Control_L" "\C-^Jg")
- (x-rebind-key "KP_5" nil "\C-^Hh")
- (x-rebind-key "KP_5" "Caps_Lock" "\C-^Hh")
- (x-rebind-key "KP_5" "Shift_L" "\C-^Ih")
- (x-rebind-key "KP_5" "Shift_R" "\C-^Ih")
- (x-rebind-key "KP_5" "Control_L" "\C-^Jh")
- (x-rebind-key "KP_6" nil "\C-^Hi")
- (x-rebind-key "KP_6" "Caps_Lock" "\C-^Hi")
- (x-rebind-key "KP_6" "Shift_L" "\C-^Ii")
- (x-rebind-key "KP_6" "Shift_R" "\C-^Ii")
- (x-rebind-key "KP_6" "Control_L" "\C-^Ji")
- (x-rebind-key "KP_7" nil "\C-^Hj")
- (x-rebind-key "KP_7" "Caps_Lock" "\C-^Hj")
- (x-rebind-key "KP_7" "Shift_L" "\C-^Ij")
- (x-rebind-key "KP_7" "Shift_R" "\C-^Ij")
- (x-rebind-key "KP_7" "Control_L" "\C-^Jj")
- (x-rebind-key "KP_8" nil "\C-^Hk")
- (x-rebind-key "KP_8" "Caps_Lock" "\C-^Hk")
- (x-rebind-key "KP_8" "Shift_L" "\C-^Ik")
- (x-rebind-key "KP_8" "Shift_R" "\C-^Ik")
- (x-rebind-key "KP_8" "Control_L" "\C-^Jk")
- (x-rebind-key "KP_9" nil "\C-^Hl")
- (x-rebind-key "KP_9" "Caps_Lock" "\C-^Hl")
- (x-rebind-key "KP_9" "Shift_L" "\C-^Il")
- (x-rebind-key "KP_9" "Shift_R" "\C-^Il")
- (x-rebind-key "KP_9" "Control_L" "\C-^Jl")
-
-
- ;; Function keys
- (x-rebind-key "F1" nil "\C-^HT")
- (x-rebind-key "F1" "Caps_Lock" "\C-^HT")
- (x-rebind-key "F1" "Shift_R" "\C-^IT")
- (x-rebind-key "F1" "Shift_L" "\C-^IT")
- (x-rebind-key "F1" "Control_L" "\C-^JT")
- (x-rebind-key "F2" nil "\C-^HU")
- (x-rebind-key "F2" "Caps_Lock" "\C-^HU")
- (x-rebind-key "F2" "Shift_R" "\C-^IU")
- (x-rebind-key "F2" "Shift_L" "\C-^IU")
- (x-rebind-key "F2" "Control_L" "\C-^JU")
- (x-rebind-key "F3" nil "\C-^HV")
- (x-rebind-key "F3" "Caps_Lock" "\C-^HV")
- (x-rebind-key "F3" "Shift_R" "\C-^IV")
- (x-rebind-key "F3" "Shift_L" "\C-^IV")
- (x-rebind-key "F3" "Control_L" "\C-^JV")
- (x-rebind-key "F4" nil "\C-^HW")
- (x-rebind-key "F4" "Caps_Lock" "\C-^HW")
- (x-rebind-key "F4" "Shift_R" "\C-^IW")
- (x-rebind-key "F4" "Shift_L" "\C-^IW")
- (x-rebind-key "F4" "Control_L" "\C-^JW")
- (x-rebind-key "F5" nil "\C-^HX")
- (x-rebind-key "F5" "Caps_Lock" "\C-^HX")
- (x-rebind-key "F5" "Shift_R" "\C-^IX")
- (x-rebind-key "F5" "Shift_L" "\C-^IX")
- (x-rebind-key "F5" "Control_L" "\C-^JX")
- (x-rebind-key "F6" nil "\C-^HY")
- (x-rebind-key "F6" "Caps_Lock" "\C-^HY")
- (x-rebind-key "F6" "Shift_R" "\C-^IY")
- (x-rebind-key "F6" "Shift_L" "\C-^IY")
- (x-rebind-key "F6" "Control_L" "\C-^JY")
- (x-rebind-key "F7" nil "\C-^HZ")
- (x-rebind-key "F7" "Caps_Lock" "\C-^HZ")
- (x-rebind-key "F7" "Shift_R" "\C-^IZ")
- (x-rebind-key "F7" "Shift_L" "\C-^IZ")
- (x-rebind-key "F7" "Control_L" "\C-^JZ")
- (x-rebind-key "F8" nil "\C-^H[")
- (x-rebind-key "F8" "Caps_Lock" "\C-^H[")
- (x-rebind-key "F8" "Shift_R" "\C-^I[")
- (x-rebind-key "F8" "Shift_L" "\C-^I[")
- (x-rebind-key "F8" "Control_L" "\C-^J[")
- (x-rebind-key "F9" nil "\C-^H\\")
- (x-rebind-key "F9" "Caps_Lock" "\C-^H\\")
- (x-rebind-key "F9" "Shift_R" "\C-^I\\")
- (x-rebind-key "F9" "Shift_L" "\C-^I\\")
- (x-rebind-key "F9" "Control_L" "\C-^J\\")
- (x-rebind-key "F10" nil "\C-^HS") ; F0
- (x-rebind-key "F10" "Caps_Lock" "\C-^HS") ; F0
- (x-rebind-key "F10" "Shift_R" "\C-^IS") ; F0
- (x-rebind-key "F10" "Shift_L" "\C-^IS") ; F0
- (x-rebind-key "F10" "Control_L" "\C-^JS") ; F0
- )
- )
- --
- ----------------------------------------------------------------------------
- Kevin Gallagher kgallagh@digi.lonestar.org OR ...!uunet!digi!kgallagh
- DSC Communications Corporation Addr: MS 152, 1000 Coit Rd, Plano, TX 75075
- ----------------------------------------------------------------------------
-