Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Nethack 3.1 numberpad problem

0 views
Skip to first unread message

Joe Hartley

unread,
Feb 2, 1993, 3:06:01 PM2/2/93
to
I'm running nethack 3.1 on a SparcStation IPX (SunOS 4.1.3, OW3.0) that has
a UNIX type 5 keyboard on it. My problem is that when I try to play nethack
in an X window with the numberpad option on, the number pad doesn't do
anything. If I use the numbers above the letters, it works, but the numeric
keypad does squat. I've tried it with the NumLock on and off, but that has
no effect. Has anyone else run into this? Any ideas for a fix that don't
involve hacking the source?

---
===============================================================================
Joe Hartley | j...@cadre.com - Whenever you find that you are on the
Cadre Technologies | side of the majority, it is time to reform. - M. Twain
222 Richmond St. | --------------------------------------------------------
Providence, RI 02903 | Overman 1st Class - the Kilgore Trout Memorial Clench
(401) 351-5950 x266 | of the Church of the SubGenius
===============================================================================

Carsten Tschach

unread,
Feb 3, 1993, 6:33:40 AM2/3/93
to
j...@cadre.com (Joe Hartley) writes:

>keypad does squat. I've tried it with the NumLock on and off, but that has
>no effect. Has anyone else run into this? Any ideas for a fix that don't
>involve hacking the source?

Here it's no Problem - I've used a normal xterm, but I've patched my Xlib
a while ago with a patch from export.lcs.mit.edu (like R5-numberpad or so).

I've you're using OpenWindows 3.0 it must work without Problems (Here on my
Sparc with a Type 4 Keyboard it does)


Bye, Carsten
--
/ Carsten Tschach tsc...@cs.tu-berlin.de tsc...@math.fu-berlin.de \
| |
| A stab in the back from the workers and bosses. They're counting their |
\ gains as you count your losses (Anne Clark) /

Joe Hartley

unread,
Feb 3, 1993, 12:08:18 PM2/3/93
to
In article 22...@infodev.cam.ac.uk, d...@mail.ast.cam.ac.uk (Derek C. Richardson) writes:

>In article 68...@fripp.ri.cadre.com, j...@cadre.com (Joe Hartley) writes:
>> I'm running nethack 3.1 on a SparcStation IPX (SunOS 4.1.3, OW3.0) that has
>> a UNIX type 5 keyboard on it. My problem is that when I try to play nethack
>> in an X window with the numberpad option on, the number pad doesn't do
>> anything.
>
>Annoying, isn't it? One fix is to use "shifted" numbers, that is, hold down
>the shift key and press the number pad key you want. Alternatively, you can
>run the following script prior to invoking the game. It remaps the keypad
>arrow keys (etc.) to the appropriate numbers. Be warned that the effect can
>only be reversed by restarting your window session. I've only tested the
>fix for OpenWindows and X11 (BTW, X11 is MUCH better for running Nethack).
>The script also disables your "Delete" key (since "." is needed on the keypad),
>but you can still you Backspace in most situations. I call the script "xnumlock".
>

[ script sacrificed to bandwith gods ]

This script had a funny impact on my type 5 keyboard; the 1, 3, 7 and 9
keys were remapped and work OK, but the up, down, left and right mapped
to the arrow keys. I'll bet the script works OK for type 4 keyboards.

Well, I've got a great place to start, though. I'll modify the script
to work for type 5's; I'll post the new one if there's any interest.

Derek C. Richardson

unread,
Feb 3, 1993, 5:01:36 AM2/3/93
to
In article 68...@fripp.ri.cadre.com, j...@cadre.com (Joe Hartley) writes:
> I'm running nethack 3.1 on a SparcStation IPX (SunOS 4.1.3, OW3.0) that has
> a UNIX type 5 keyboard on it. My problem is that when I try to play nethack
> in an X window with the numberpad option on, the number pad doesn't do
> anything. If I use the numbers above the letters, it works, but the numeric
> keypad does squat. I've tried it with the NumLock on and off, but that has
> no effect. Has anyone else run into this? Any ideas for a fix that don't
> involve hacking the source?

Annoying, isn't it? One fix is to use "shifted" numbers, that is, hold down


the shift key and press the number pad key you want. Alternatively, you can
run the following script prior to invoking the game. It remaps the keypad
arrow keys (etc.) to the appropriate numbers. Be warned that the effect can
only be reversed by restarting your window session. I've only tested the
fix for OpenWindows and X11 (BTW, X11 is MUCH better for running Nethack).
The script also disables your "Delete" key (since "." is needed on the keypad),
but you can still you Backspace in most situations. I call the script "xnumlock".

Hope this helps!

---cut here---
#!/bin/csh -f
#
xmodmap -e 'keysym Insert = 0' >& /dev/null
xmodmap -e 'keysym F33 = 1' >& /dev/null
xmodmap -e 'keysym Down = 2' >& /dev/null
xmodmap -e 'keysym F35 = 3' >& /dev/null
xmodmap -e 'keysym Left = 4' >& /dev/null
xmodmap -e 'keysym F31 = 5' >& /dev/null
xmodmap -e 'keysym Right = 6' >& /dev/null
xmodmap -e 'keysym F27 = 7' >& /dev/null
xmodmap -e 'keysym Up = 8' >& /dev/null
xmodmap -e 'keysym F29 = 9' >& /dev/null
xmodmap -e 'keysym Delete = period' >& /dev/null
xmodmap -e 'keysym F24 = equal' >& /dev/null
xmodmap -e 'keysym F25 = slash' >& /dev/null
xmodmap -e 'keysym F26 = asterisk' >& /dev/null
xmodmap -e 'keysym KP_Subtract = minus' >& /dev/null
xmodmap -e 'keysym KP_Add = plus' >& /dev/null
xmodmap -e 'keysym KP_Enter = Return' >& /dev/null
#
---cut here---

-----------------------------------------------------------
| Derek C. Richardson | Tel: (0223) 337548 x 37501 |
| Institute of Astronomy | Fax: (0223) 337523 |
| Cambridge, U.K. | |
| CB3 0HA | E-mail: d...@mail.ast.cam.ac.uk |
-----------------------------------------------------------

Joe Hartley

unread,
Feb 3, 1993, 3:29:30 PM2/3/93
to
Well, I modified the script that had been posted to work with my type 5
keyboard, and all seems fine now. My cursor keys still work, and now
the numeric keypad always spits out numbers. I'm so happy....
Anyway, here's the script. As has been mentioned, this can be modified
to be a list of commands to a single invocation of xmodmap, but this works,
and I'm not inclined to play with it anymore. Just write this to a file,
call it from your .xinitrc and you're all set!

--------------- 8< Cut here 8< ------------------
#!/bin/csh -f
#
xmodmap -e 'keycode 101 = 0' >& /dev/null
xmodmap -e 'keycode 119 = 1' >& /dev/null
xmodmap -e 'keycode 120 = 2' >& /dev/null
xmodmap -e 'keycode 121 = 3' >& /dev/null
xmodmap -e 'keycode 98 = 4' >& /dev/null
xmodmap -e 'keycode 99 = 5' >& /dev/null
xmodmap -e 'keycode 100 = 6' >& /dev/null
xmodmap -e 'keycode 75 = 7' >& /dev/null
xmodmap -e 'keycode 76 = 8' >& /dev/null
xmodmap -e 'keycode 77 = 9' >& /dev/null
xmodmap -e 'keycode 57 = period' >& /dev/null
xmodmap -e 'keycode 78 = minus' >& /dev/null
xmodmap -e 'keycode 53 = slash' >& /dev/null
xmodmap -e 'keycode 54 = asterisk' >& /dev/null
xmodmap -e 'keycode 132 = plus' >& /dev/null
xmodmap -e 'keycode 97 = Return' >& /dev/null
#
--------------- 8< Cut here 8< ------------------

Derek C. Richardson

unread,
Feb 3, 1993, 10:31:44 AM2/3/93
to
It's just been pointed out to me that the xnumlock script
I posted would be more efficient if the mapping expressions
were stored in a file. Then you can just xmodmap the whole
thing at once. I leave this implementation as an exercise...

Derek

P.S. Under OpenWindows, the xmodmap doesn't affect EXISTING
command tools...you have to make new ones. Works fine
for xterms.

Parental Advisory

unread,
Feb 3, 1993, 5:29:21 AM2/3/93
to
Joe Hartley (j...@cadre.com) wrote:
: I'm running nethack 3.1 on a SparcStation IPX (SunOS 4.1.3, OW3.0) that has

: a UNIX type 5 keyboard on it. My problem is that when I try to play nethack
: in an X window with the numberpad option on, the number pad doesn't do
: anything. If I use the numbers above the letters, it works, but the numeric
: keypad does squat. I've tried it with the NumLock on and off, but that has
: no effect. Has anyone else run into this? Any ideas for a fix that don't
: involve hacking the source?
:
That is a problem with the X11R5 server, not nethack. There was a patch
floating around (somewhere) that supposedly fixed that, but I don't know where
it might be. You need to buy your sys admin, or remember to hit the numlock
key BEFORE going into X (of course that means no cursor keys).

If there are any other options, I'd be interested to hear them... maybe you
can remap the keyboard in XTerm?

: ---


: ===============================================================================
: Joe Hartley | j...@cadre.com - Whenever you find that you are on the
: Cadre Technologies | side of the majority, it is time to reform. - M. Twain
: 222 Richmond St. | --------------------------------------------------------
: Providence, RI 02903 | Overman 1st Class - the Kilgore Trout Memorial Clench
: (401) 351-5950 x266 | of the Church of the SubGenius
: ===============================================================================

--
____ ____ ____ To seek out new structs, and polymorphism...
// \\ // \\ ||// To boldy go where no to has gone before...
\\__// \\__// ||
Chris Meshkin (mes...@sol.cs.wmich.edu) > WMU <

Carsten Tschach

unread,
Feb 3, 1993, 3:31:38 PM2/3/93
to
j...@cadre.com (Joe Hartley) writes:

>This script had a funny impact on my type 5 keyboard; the 1, 3, 7 and 9
>keys were remapped and work OK, but the up, down, left and right mapped
>to the arrow keys. I'll bet the script works OK for type 4 keyboards.
>
>Well, I've got a great place to start, though. I'll modify the script
>to work for type 5's; I'll post the new one if there's any interest.

Get 'xkeycaps.tar.Z' from export.lcs.mit.edu - It's an X11-Program which
displays the keyboard (the new Version from Jan 93 also supports Type 5-
Keyboards) and you can modify the Keys with your mouse. After than it
makes an xmodmap-Output so that you can load it every time you start
X11.


Bye, Carsten

Patrick J. Horgan

unread,
Feb 3, 1993, 10:26:07 AM2/3/93
to
It seems there's a misconception going on here...the type 5 keyboard he's
talking about has separate cursor keys and numeric keypad. It's wonderful:)

Patrick
--

These opinions are mine, and not Amdahl's (except by coincidence;).

~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
/ | | (\ \
| Patrick J. Horgan | Amdahl Corporation | \\ Have |
| pj...@da.amdahl.com | 1250 East Arques Avenue | \\ _ Sword |
| Phone : (408)992-2779 | P.O. Box 3470 M/S 253 | \\/ Will |
| FAX : (408)773-0833 | Sunnyvale, CA 94088-3470 | _/\\ Travel |
\ | | \) /
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~

Adam Thompson

unread,
Feb 4, 1993, 1:16:03 PM2/4/93
to

>I'm running nethack 3.1 on a SparcStation IPX (SunOS 4.1.3, OW3.0) that has
>a UNIX type 5 keyboard on it. My problem is that when I try to play nethack
>in an X window with the numberpad option on, the number pad doesn't do
>anything. If I use the numbers above the letters, it works, but the numeric
>keypad does squat. I've tried it with the NumLock on and off, but that has
>no effect. Has anyone else run into this? Any ideas for a fix that don't
>involve hacking the source?

This isn't a bug in NH, it's a bug in OpenWindows. There is a patch
available on export that can be applied to your Openwin server. Basically,
forget it unless you're the sysadmin. You could also rebuild X11R5 with
the Sun kbd patches, but again...

-Adam Thompson
tho...@ccu.umanitoba.ca
--
+----------------------------------------------------------------------+
| Adam Thompson University of Manitoba Computer Services |
| <Adam_T...@umanitoba.ca> OLC Project - Unix Group |
| UNIX -- where you can do anything in two keystrokes, or less... |

0 new messages