Subject: Re: Sun Type6 USB keyboard & X
To: Sean Davis <>
From: Michael <>
List: current-users
Date: 10/24/2005 13:01:41
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable


> > > > 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
> NetBSD 3.0?
> XFree86 Version 4.5.0
> NetBSD 3.99.10 NetBSD 3.99.10 (JANE) #8: Sun Oct
> 23 20:59:00 EDT 2005 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

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

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

Content-Type: application/pgp-signature

Version: GnuPG v1.4.0 (NetBSD)