X server and xinit works excellent....almost.

Polytropon freebsd at edvax.de
Thu Nov 10 01:01:25 UTC 2011


On Wed, 09 Nov 2011 13:10:20 -0800, Chuck Swiger wrote:
> Hi--
> 
> On Nov 9, 2011, at 12:02 PM, Michael Cardell Widerkrantz wrote:
> >> And should HAL have discovered my swedish keyboard automatically in
> >> the first place, so there was something going wrong there?
> > 
> > How would HAL know that the keyboard had a Swedish layout? No such
> > information is sent through USB or PS/2 when you attach a keyboard.
> 
> True for PS/2, but not true for USB-- the USB Vendor & Product
> ID can identify different keyboard types and let you infer the
> country.

"Can" - I think it's not standard to do so.



>  For example, see:
> 
>   http://www.linux-usb.org/usb.ids

Just checked, and the exception is right here: I'm using a
Sun USB keyboard + mouse, 0x0430 = Sun Microsystems, Inc. is
correct, but 0x100e = 24.1" LCD Monitor v4 / FID-638 Mouse
seems to be nonsense. It's a mouse, _infront_ of a 24" monitor,
but that's an EIZO CRT. :-)

In this regards, it's also strange how FreeBSD could "forget"
USB information it once had.

On my old 5.x system, I got dmesg lines like that:

	ukbd0: Sun Microsystems Type 6 USB keyboard,
		rev 1.00/1.02, addr 3, iclass 3/1 
	ums0: Sun Microsystems Type 6 USB mouse,
		rev 1.00/1.02, addr 2, iclass 3/1 

But since 7.0 (6.0 hasn't been introduced to my home system),
I get

	ukbd0: <vendor 0x0430 product 0x0005,
		class 0/0, rev 1.00/1.02, addr 3> on uhub1 
	ums0: <vendor 0x0430 product 0x0100,
		class 0/0, rev 1.00/1.02, addr 2> on uhub1

Note that the corresponding file in the source tree containing
the USB devices still has the proper data! And I haven't changed
things on hardware side. But maybe this is because the USB
subsystem has had many changes...

Now that I have a type 7 keyboard, the USB information still
is not useful:

	% usbconfig -u 1 -a 3 dump_info
	ugen1.3: <Sun USB Keyboard vendor 0x0430> at usbus1,
		cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
	% usbconfig -u 1 -a 2 dump_info
	ugen1.2: <product 0x100e vendor 0x0430> at usbus1,
		cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE

	% dmesg | grep "^u[km]"
	ukbd1: <vendor 0x0430 Sun USB Keyboard,
		class 0/0, rev 2.00/1.05, addr 3> on usbus1
	ums0: <vendor 0x0430 product 0x0100,
		class 0/0, rev 1.00/1.02, addr 4> on usbus1
	ums0: 3 buttons and [XY] coordinates ID=0

You can also see that dmesg logs different data (0x100e vs. 0x0100).



> At the moment, I happen to be using a:
> 
> Apple Pro Keyboard:
>   Product ID: 0x020b
>   Vendor ID: 0x05ac  (Apple Inc.)
>   Version:  4.20
>   Speed: Up to 12 Mb/sec
>   Manufacturer: Mitsumi Electric
>   Location ID: 0x3d111300 / 6
>   Current Available (mA): 250
>   Current Required (mA): 50
> 
> ...and this database would correctly let the system know
> that I'm using US layout:
> 
>   020b  Pro Keyboard [Mitsumi, A1048/US layout]
> 
> If you figure out that a Logitech Tangentbord K120 (or an Apple
> MC184S) is connected, then you've got a Swiss keyboard, and so
> forth.

This is fine as long as you're going to keep that language
settings. However, there are users who need a non-US language
on a US keyboard layout - or vice versa. In such a case, the
autodetection doesn't help.

Your example with Apple hardware corresponds to my experience.
I also have an older Mac keyboard which works fine on FreeBSD,
including proper device identification.

My assumption still is: Not _every_ keyboard manufacturer does
code the layout into the USB identification. If you tell me I'm
wrong with this assumption, I'll be happy. :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list