Subject: Re: Sun Type6 USB keyboard & X
To: Sean Davis <dive@endersgame.net>
From: Michael <macallan18@earthlink.net>
List: current-users
Date: 10/24/2005 13:01:41
--Signature_Mon__24_Oct_2005_13_01_41_-0400_st_EgzF=/04trQd0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hello,

> > > > I've recently switched to a type6 usb keyboard on my PC. Using
> > > > wskbd @ ukbd is working just fine for console and X, however I'm
> > > > wondering.. where do I need to dig around if I'd like to use the
> > > > sun buttons (the L pad on the left, and the volume
> > > > controls/sleep button on the right)? I was looking at output
> > > > from xev, and nothing happens when those keys are punched. I
> > > > would like to bind them to perform useful functions (or at least
> > > > keystrokes) but I don't see how I could do that with xmodmap if
> > > > xev isn't even picking up keypress/release events.
> > > >=20
> > > > Any pointers would be much appreciated.
> > >=20
> > > Do you get any other uhid devices? (The whole probe output from
> > > the keyboard would be good to see) Sometimes keyboards with
> > > "extra" magic keys have them show up as non-keyboard HID input
> > > widgets.
> >=20
> > This is a bug ( or a misfeature ) in XFree's USB keymap and has been
> > fixed in 3.0. In 2.x and older the Sun keys are simply mapped to
> > nothing and there's no way to change this short of recompiling part
> > of the Xserver.=20
>=20
> NetBSD 3.0?
> XFree86 Version 4.5.0
> NetBSD jane.endersgame.net 3.99.10 NetBSD 3.99.10 (JANE) #8: Sun Oct
> 23 20:59:00 EDT 2005
dive@jane.endersgame.net:/sys/arch/i386/compile/JANE i386

This should be recent enough, the keyboard stuff has been committed
months ago. Which keyboard driver are you using?=20

The section for the Sun keyboard in your XF86Config should look like
this:

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option  "XkbRules" "xfree86"
        Option  "XkbModel" "pc105"
        Option  "XkbLayout" "us"
        Option      "Protocol" "wskbd"
        Option      "Device" "/dev/wskbd"
EndSection

XkbModel is a blatant lie but right now it has to be like that. It
definitely works for me ( on sparc64 and macppc )

> So I just need to rebuild xsrc, I guess? (also, what is this usb
> keymap you speak of? :)

No need to rebuild I think.
XFree translates all keyboard input to a common set of keycodes ( that's
why the Xkb rules look so weird ), it has a bunch of compiled-in tables
for this. The table for USB keyboards was missing the Sun extra keys so
they are mapped to nothing which is why you don't see events in xev.
There are two keyboard drivers - 'keyboard' which only works properly
with PS/2 and USB keyboards and doesn't know about Sun keys and 'kbd'
which only works properly with everything else and USB and which does
know about the extra keys ( it doesn't properly translate multibyte PS/2
scancodes, that's why it has problems with PS/2 keyboards )

have fun
Michael

--Signature_Mon__24_Oct_2005_13_01_41_-0400_st_EgzF=/04trQd0
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (NetBSD)

iQEVAwUBQ10TdcpnzkX8Yg2nAQJ4NAgAhyiIpUgydmEWM7SVNqknmY8KSYWUXvBD
I8ojg5OtmfA9yX2ir2geWltpD/A6L2ZOBECM9f8cMNb/AZasg5jMcgtFw57krylJ
lCSn+uvvW4tsm2xXRT3brHRkBIZKi3DJCz3l1eVmOt5r43issg8N7Q3El10CcGYs
+qmsVWvqAUPGCUvab+tBdjxu0sFq10QncHRphe2+cqkJ9pGmxCzLt9omR2tADYQX
SMdG4YrYTpvo7I2MCLG0f196hvRKfKAMZhWWOjVH98Fn1dQmBiTop1WLjd2XKfZ6
n/SciY7baMWYY6/KD6PnZV+ZLK1iNfbecGiDL7nCSAjtwAREOiLInw==
=jCZx
-----END PGP SIGNATURE-----

--Signature_Mon__24_Oct_2005_13_01_41_-0400_st_EgzF=/04trQd0--