🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #99431

Re: Arrow keys (was Re: philosophical bugs in emacs)

#99431
From: Noldoatan
Date: Thu, 06 Sep 1990 22:28
74 lines
3928 bytes
In article <1990Sep6.132819.26831@warwick.ac.uk> cudcv@warwick.ac.uk (Rob McMahon) writes:
> In article <9009051757.AA20732@life.ai.mit.edu> gildea@ALEXANDER.BBN.COM (Stephen Gildea) writes:
> >  The basic movement commands are difficult to master because they involve
> >  control characters, and the keys are widely separated on the keyboard, ...
> >
> >Use the arrow keys.  I rebind my left and right arrows to move by
> >words, and thus I can use just the arrow keys to move quickly to within a
> >word of where I want to be.

> This is one of the commonest complaints I get when I try to persuade
> people to use emacs-style editors round here: "But the arrow keys
> don't work...".  Most of our dumb terminals are TeleVideos (or Wyse's
> emulating TeleVideos) that send ^H, ^V, ^K, and ^L for the arrow keys.
> What am I supposed to do with the previous uses of these control keys?
> Particularly ^V and ^K which are pretty fundamental.  I don't want
> to use a different keymap on every terminal round here.

At our lab, we use WYSE-50's which use ^H, ^J, ^K, and ^L, which are
ALL horrible keys for arrow keys.  I'll post my fix, which is a real
kludge, and maybe someone else will have a better idea.  My solution
is to toggle the numeric keypad (of course, some terminals won't have
one) to give you cursor control instead of numbers.  DON'T FORGET to
switch these off when you are trying to type numbers, because it
changes the bindings of the numbers across the top of the keyboard
too!

------------------------------------------------------------------------
; Keypad will be set up like an IBM-PC:
; HOME (beginning-of-line)	UP (previous-line)	PAGE-UP (scroll-down)  
; LEFT (backward-char)		(goto-line)		RIGHT (forward-char)
; END (end-of-line)		DOWN (next-line)	PAGE-DN (scroll-up)

(defvar *keypad-mode* 'numeric)
(defun toggle-wyse-keypad-mode ()
  "Invoking this function remaps the number keys to movement functions, and
back again."
  (interactive nil)
  (cond ((eq *keypad-mode* 'numeric)
	 (setq *keypad-mode* 'movement)
	 (wysetell "movement")
	 (global-set-key "1" 'end-of-line)
	 (global-set-key "2" 'next-line)
	 (global-set-key "3" 'scroll-up)
	 (global-set-key "4" 'backward-char)
	 (global-set-key "5" 'goto-line)
	 (global-set-key "6" 'forward-char)
	 (global-set-key "7" 'beginning-of-line)
	 (global-set-key "8" 'previous-line)
	 (global-set-key "9" 'scroll-down)
	)
	(t
	 (setq *keypad-mode* 'numeric)
	 (echo-keypad-mode)
	 (let ((ccode 48))
	   (while (< ccode 58)
	     (global-set-key (char-to-string ccode) 'self-insert-command)
	     (setq ccode (1+ ccode))
	   )
         )
	)
  )
)

(defun echo-keypad-mode ()
  "Print mode wyse keypad is in."
  (interactive nil)
  (prin1 *keypad-mode* t)
)

; These key sequences are the Ins/Repl key of they WY-50, at the
; corner of the keypad, used to toggle the keypad between numeric and
; cursor control, and inform you of the current state.
(global-set-key "\er" 'toggle-wyse-keypad-mode)
(global-set-key "\eq" 'echo-keypad-mode)
Technical Details
Message-ID: <GHN.90Sep6182801@cognito.Princeton.EDU>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!bu.edu!dimacs.rutgers.edu!aramis.rutgers.edu!paul.rutgers.edu!njin!princeton!phoenix.princeton.edu!ghn
References: <9009051757.AA20732@life.ai.mit.edu> <1990Sep6.132819.26831@warwick.ac.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,ad6f12f51d80670c
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1990-09-07 07:35:16 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!bu.edu!dimacs.rutgers.edu!aramis.rutgers.edu!paul.rutgers.edu!njin!princeton!phoenix.princeton.edu!ghn
From: ghn@clarity.Princeton.EDU (Noldoatan)
Newsgroups: gnu.emacs.bug
Subject: Re: Arrow keys (was Re: philosophical bugs in emacs)
Message-ID: <GHN.90Sep6182801@cognito.Princeton.EDU>
Date: 6 Sep 90 22:28:01 GMT
References: <9009051757.AA20732@life.ai.mit.edu>
 <1990Sep6.132819.26831@warwick.ac.uk>
Sender: news@idunno.Princeton.EDU
Distribution: gnu
Organization: Cognitive Science Lab.  Princeton University.
Lines: 74
Posted: Thu Sep  6 23:28:01 1990
In-reply-to: cudcv@warwick.ac.uk's message of 6 Sep 90 13:28:19 GMT