🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #902

vt100 arrow keys suggestion

#902
From: Eric Ludlam v 2.1a
Date: Tue, 15 Dec 1992 15:10
44 lines
2541 bytes
Howdy,

  I've been doing a fair amount of emacs programming on vt300's and
vt400's over the past few months, and I have the following suggestion
for dealing with the vt100 style arrow keys.  The files vt100.el and
vt200.el both use keypad.el which sets up a "keypad" of letters bound
to functions.  This works great for standard editing where \C-f is
always bound to forward-char.

  Now lets say you want to rebind \C-f and company to do movement in a
game, ie move some piece or marker around.  Suddenly the arrow keys
get all confused and move the cursor instead of moving the piece or
marker.  This is annoying.

  My suggestion is the following.  Emacs has this way kool ability to
allow you to put a string into a keybinding slot which acts as a
macro.  As a result, I have the following redefinitions in my .emacs
file:

(define-key global-map "\e[A" "\C-p")
(define-key global-map "\e[B" "\C-n")
(define-key global-map "\e[C" "\C-f")
(define-key global-map "\e[D" "\C-b")
(define-key global-map "\eOA" "\C-p")
(define-key global-map "\eOB" "\C-n")
(define-key global-map "\eOC" "\C-f")
(define-key global-map "\eOD" "\C-b")

  This way, in cases (such as view-mode, dired-mode, games etc, the
arrows are always bound to whatever the \C-f keys are bound to.  In
any professional release, these definitions would be under CSI-map or
somesuch, but the action of using strings makes some modes easier to
deal with.  This, of course, will cause problems when moving to such
emulators as vip or EDT modes, but in general I think this seems kool.

  Anyways this is just a suggestion to any who'd care listen.

  -Eric
--
 +---------------------------+--------------------------------------------+
 | Eric M. Ludlam            | Student Supervisor of Mainframe Consulting |
 | zappo@titan.ucc.umass.edu |         University Computing Services      |
 | zappo@gnu.ai.mit.edu      |  University of Massachusetts, Amherst MA   |
 +---------------------------+--------------------------------------------+
Technical Details
Message-ID: <ZAPPO.92Dec15101005@titan.ucc.umass.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sdd.hp.com!cs.utexas.edu!uwm.edu!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!titan.ucc.umass.edu!zappo

Show Full Headers
Complete Article Headers
Newsgroups: gnu.emacs.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sdd.hp.com!cs.utexas.edu!uwm.edu!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!titan.ucc.umass.edu!zappo
From: zappo@titan.ucc.umass.edu (Eric Ludlam v 2.1a)
Subject: vt100 arrow keys suggestion
Message-ID: <ZAPPO.92Dec15101005@titan.ucc.umass.edu>
Sender: gnulists@ai.mit.edu
Organization: University Computing Services
Distribution: gnu
Date: Tue, 15 Dec 1992 15:10:05 GMT
Approved: bug-gnu-emacs@prep.ai.mit.edu
Lines: 45