🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

3 total messages Started by James Tayler Mon, 22 Jul 1991 19:40
key mapping
#1934
Author: James Tayler
Date: Mon, 22 Jul 1991 19:40
13 lines
1291 bytes
Hi there.  I hope y'all can help us with a key mapping problem.  We are running epoch on Sun workstations under Xwindows and are having a great deal of trouble getting some of the function keys to work. Or for that matter, figuring out why some of them work and some don't.  Our cursor keys work, but the pgup,pgdn, home and end do not.  We are getting an ESC xxxz type response.  I know that there is a way to rebind these keys, but have had no luck figuring it out on my own.  Can anybody give me a simple way



 of rebinding these keys to do what they are supposed to???  ie, hit pgup and the screen scrolls up, etc....


Thanks

Jim Taylor
Applied Research Labs
University of Texas at Austin
taylor@titan.tsd.arlut.utexas.edu
Re: key mapping
#1938
Author: Brian L. Kahn
Date: Tue, 23 Jul 1991 05:52
16 lines
973 bytes
Make .xmodmap in your home directory:

keysym R7 = Home
keysym R9 = Prior
keysym R13 = End
keysym R15 = Next




Put this into your .xinitrc:

xmodmap $HOME/.xmodmaprc
--
B<   Brian Kahn   blk@security.mitre.org   "may the farce be with you"
Re: key mapping
#1939
Author: Alan M. Carroll
Date: Tue, 23 Jul 1991 13:53
59 lines
3557 bytes
Key mapping is a little strange, due to the way X works. For various
technical reasons (which I can provide for those interested), it's not
feasible to provide direct access to the KeySyms of X. For instance,
if you press PgDn on a Sparc keyboard, X reports the PageDown KeySym
to Epoch, which doesn't correspond to any ASCII key.

GNU Emacs deals with this by using internal, hardwired mappings. For
Suns, the cursor keys are mapped into the standard cursor movement
keys (do a global-set-key on ^P and then see what the up arrow does).
Other X KeySyms are mapped into the ESC xxxz (xxx~ for non-Suns)
sequences, presumably because of the way VT100's worked. This is the
default in Epoch, for compatability reasons. However, if this annoys
you as much as it annoys me, you can turn it off by setting the
variable epoch::function-key-mapping to nil.

The X window system provides the ability to have particular KeySyms
generate arbitrary ASCII sequences, and Epoch provides access to this
feature via the (rebind-key) function. So, to have F1 generate ESC
(which is sort of handy), you can do

(rebind-key "F1" nil "\C-[")

As a side note, rebind-key works on _any_ key. For instance, I use
control minus to close all but the current window (normally ^X1). I do
this with

(rebind-key "minus" 'control "\C-^C-")
(global-set-key "\C-^C-" 'delete-other-windows)	;control -

The problem is that non-ASCII KeySyms must be maped into ASCII
sequences, and the set of sequences is crowded under Emacs. My
solution was to establish my own convention for rebinding, where all
rebound sequences start with control ^ (which is unused), followed by
standardized indicators. Code that does this can be found in
./contrib/amc/keys.el, which is the version that I used at the time of
the 3.2 release (I've since upgraded, since I'm always fiddling with
things).

What's the point? In order to have PgUp do what you expect, you have
to do 2 things. First, rebind-key the KeySym to an ASCII sequence.
Second, global-set-key that sequence to an interactive function that
moves up a page. For a Sun-4 keyboard, this could be done with

(rebind-key "R9" nil "\C-^k9")
(global-set-key "\C-^k9" 'scroll-down)	; Page Up

I recommend the use of the "xev" program for this. It will tell you
what KeySym is being generated by a particular key. Also, note that
these rebindings apply only to Epoch, not to other X clients that
might be running.

Douglas Rand also wrote an improved version of the system I used,
where much of the work is done automatically, which I can repost if
there's a lot of demand for it.

-- 
Alan M. Carroll          <-- Another casualty of applied metaphysics
Epoch Development Team   
Urbana Il.               "I hate shopping with the reality-impaired" - Susan
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads