Subject: Re: Jornada X keyboard problems.
To: None <hpeyerl@beer.org>
From: Brad Spencer <brad@anduin.eldar.org>
List: port-hpcarm
Date: 08/20/2002 10:17:42
   I've done some more playing with X on the J720.  Following this is 
   my keymap file for those who are interested in playing with this.

Hello....  I'v also been looking at this a bit, also...

[A slightly related question]

Is it possible to make the touchscreen hold a "mouse" button down and not
just produce a quick click??  It is very hard to use the menus in twm,
xterm and probably emacs with just a button click??

   I'm seeing a couple different things happening here..

   First of all, the 'm' key does _not_ generate any Keypress or
   Keyrelease events at all.  So I can't use the 'm' key under X
   at all.  It works fine on the console with wscons.

   Secondly, the keypress/keyrelease events seem to get out of sync
   with one another.  If, for example, I press/release the 'f' key,
   I get a KeyPress event but not KeyRelease.  If I then press/release
   the 'f' key again, I get a KeyRelease and a KeyPress event:

[snip]

What I had noticed is that every key would repeat, apparently forever.
After some debugging statements were inserted into the Xhpc server, I also
noticed that the raw key codes being used by the X server did not match
any sort of reality that I could figure out.

On a hunch, I reenabled the use of /dev/wskbd in the Xhpc server, as that
appears to work on hpcarm.  Here is a little patch that you apply against
the file:

	       xc/programs/Xserver/hw/netbsd/hpc/hpcInit.c


--- hpcInit.c.DIST	Sun Aug 18 11:18:55 2002
+++ hpcInit.c	Mon Aug 19 22:57:53 2002
@@ -232,7 +232,6 @@
 	for (i = 0; i < 8; i++) {
 	    char devname[16];
 
-#if 0
 	    /*
 	     * We can't use wskbd for now, because primary keyboard(wskbd0)
              * is already connected with console(/dev/ttyE0).
@@ -241,7 +240,6 @@
 		sprintf(devname, "/dev/wskbd%d", i);
 		hpcKbdPriv.fd = open(devname, O_RDWR);
 	    }
-#endif
 
 	    if (hpcPtrPriv.fd == -1) {
 		sprintf(devname, "/dev/wsmouse%d", i);


If you use the above patch and the keymap at the end of this mail, the
keyboard becomes usable.  All keys that map into a signed byte appear to
work.  Note that the keymap is just the raw key codes from
src/sys/arch/hpcarm/dev/j720kbdmap.c plus 8, which is all consistant with
what is in hpcKbd.c.  Also note that the Fn key is not working.  The PR I
submitted about that issue mapped the Fn keys above the size that a byte
can hold and that does not sit well with the X server.

There is some room for improvement even with this.  I could not get the
keyboard mouse support to work, and the "WINDOWS" MENU key is currently
mapped to Meta.  I wasn't successful in getting this to work in any other
manor.

keycode 8 =
keycode 9 = Escape
keycode 10 = F1
keycode 11 = F2
keycode 12 = F3
keycode 13 = F4
keycode 14 = F5
keycode 15 = F6
keycode 16 = F7
keycode 17 = F8
keycode 18 = F9
keycode 19 = F10
keycode 20 = F11
keycode 21 =
keycode 22 =
keycode 23 =
keycode 24 =
keycode 25 = 1 exclam
keycode 26 = 2 at
keycode 27 = 3 numbersign
keycode 28 = 4 dollar
keycode 29 = 5 percent
keycode 30 = 6 asciicircum
keycode 31 = 7 ampersand
keycode 32 = 8 asterisk
keycode 33 = 9 parenleft
keycode 34 = 0 parenright
keycode 35 = minus underscore
keycode 36 = equal plus
keycode 37 =
keycode 38 =
keycode 39 =
keycode 40 =
keycode 41 = q
keycode 42 = w
keycode 43 = e
keycode 44 = r
keycode 45 = t
keycode 46 = y
keycode 47 = u
keycode 48 = i
keycode 49 = o
keycode 50 = p
keycode 51 = backslash bar
keycode 52 = BackSpace
keycode 53 =
keycode 54 =
keycode 55 =
keycode 56 =
keycode 57 = a
keycode 58 = s
keycode 59 = d
keycode 60 = f
keycode 61 = g
keycode 62 = h
keycode 63 = j
keycode 64 = k
keycode 65 = l
keycode 66 = semicolon colon
keycode 67 = bracketright braceright
keycode 68 =
keycode 69 =
keycode 70 =
keycode 71 =
keycode 72 =
keycode 73 = z
keycode 74 = x
keycode 75 = c
keycode 76 = v
keycode 77 = b
keycode 78 = n
keycode 79 = m
keycode 80 = comma less
keycode 81 = period greater
keycode 82 =
keycode 83 = apostrophe quotedbl
keycode 84 = Return
keycode 85 =
keycode 86 =
keycode 87 =
keycode 88 =
keycode 89 = Tab
keycode 90 =
keycode 91 = Shift_L
keycode 92 =
keycode 93 =
keycode 94 =
keycode 95 =
keycode 96 =
keycode 97 =
keycode 98 = Up
keycode 99 =
keycode 100 = Shift_R
keycode 101 =
keycode 102 =
keycode 103 =
keycode 104 =
keycode 105 =
keycode 106 =
keycode 107 =
keycode 108 =
keycode 109 = Alt_L
keycode 110 =
keycode 111 =
keycode 112 =
keycode 113 = Left
keycode 114 = Down
keycode 115 = Right
keycode 116 =
keycode 117 =
keycode 118 =
keycode 119 =
keycode 120 =
keycode 121 = Meta_L
keycode 122 = Control_L
keycode 123 =
keycode 124 = space
keycode 125 =
keycode 126 =
keycode 127 =
keycode 128 = slash question
keycode 129 = Delete
clear shift
clear lock
clear control
clear mod1
clear mod2
clear mod3
clear mod4
add shift = Shift_L Shift_R
add control = Control_L
add mod1 = Meta_L
add mod4 = Alt_L





-- 
Brad Spencer - brad@anduin.eldar.org
http://anduin.eldar.org  - & -  http://anduin.ipv6.eldar.org [IPv6 only]
[finger brad@anduin.eldar.org for PGP public key]