Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 Fluke 8/7/84; site fluke.UUCP Path: utzoo!watmath!clyde!burl!mgnetp!ihnp4!mhuxl!houxm!vax135!cornell!uw-beaver!ssc-vax!fluke!rzdz From: rzdz@fluke.UUCP (Rick Chinn) Newsgroups: net.emacs Subject: Re: Arrow Key Problems Message-ID: <360@tpvax.fluke.UUCP> Date: Thu, 23-Aug-84 17:19:50 EDT Article-I.D.: tpvax.360 Posted: Thu Aug 23 17:19:50 1984 Date-Received: Thu, 30-Aug-84 00:36:50 EDT References: <446@hogpc.UUCP> Organization: John Fluke Mfg. Co., Everett, WA Lines: 72 As I recall, emacs really doesn't know anything about your terminal's arrow keys, even though they are part of your termcap. Here is how I handle the problem of the arrow keys on our vt100s. We really don't use them very much, since we mostly just use emacs for writing text. Rick Chinn John Fluke Mfg. Co MS 232E PO Box C9090 Everett WA 98206 ihnp4!uw-beaver----\ decvax!microsof \ ucbvax!lbl-csam \ +====!fluke!rzdz sun / sb1!allegra / ssc-vax------------/ (206) 356-5232 ;Thu Aug 23 14:13:50 1984 rzdz ; ARROW KEYS ; (setq-default arrow-mode 0) ;default to cut and paste ; ; set the default arrow key defs if not already done (if (! (is-bound old-down-arrow-def)) (setq-default old-down-arrow-def "next-line")) (if (! (is-bound old-up-arrow-def)) (setq-default old-up-arrow-def "previous-line")) (if (! (is-bound old-left-arrow-def)) (setq-default old-left-arrow-def "paste")) (if (! (is-bound old-right-arrow-def)) (setq-default old-right-arrow-def "cut")) ; ; initial bindings (bind-to-key old-up-arrow-def "\eOA") (bind-to-key old-down-arrow-def "\eOB") (bind-to-key old-left-arrow-def "\eOD") (bind-to-key old-right-arrow-def "\eOC") ; this function toggles the arrow keys between the two sets of functions (defun (toggle-arrow-mode down-arrow up-arrow left-arrow right-arrow (if (= arrow-mode 0) (progn (message "arrow keys control direction") (sit-for 0) ; save the current arrow key bindings (setq old-down-arrow-def (global-binding-of "\eOB")) (setq old-up-arrow-def (global-binding-of "\eOA")) (setq old-left-arrow-def (global-binding-of "\eOD")) (setq old-right-arrow-def (global-binding-of "\eOC")) ; now rebind them for direction control (bind-to-key "previous-line" "\eOA") (bind-to-key "next-line" "\eOB") (bind-to-key "backward-character" "\eOD") (bind-to-key "forward-character" "\eOC") (setq arrow-mode 1) (nothing)) (progn (message "arrow keys cut and paste") (sit-for 0) ; rebind the arrow keys to the old bindings (bind-to-key old-up-arrow-def "\eOA") (bind-to-key old-down-arrow-def "\eOB") (bind-to-key old-left-arrow-def "\eOD") (bind-to-key old-right-arrow-def "\eOC") (setq arrow-mode 0) (nothing)))) )