Keyboard problems with xorg 7.4 + hal

Dan Nicholson dbn.lists at gmail.com
Thu Mar 19 12:18:37 PDT 2009


On Thu, Mar 19, 2009 at 11:51 AM, Renato Botelho <rbgarga at gmail.com> wrote:
> Hello,
>
> I'm using FreeBSD 8.0-current
>
> I use a Sun Type 7 keyboard and trying to use xorg-7.4 with hal,
> I need some sun symbols to use kbd special keys on xorg, so,
> i've added this keyboard.fdi file:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <deviceinfo version="0.2">
>       <device>
>               <match key="info.capabilities" contains="input.keyboard">
>               <match key="info.product" contains="Type 7 USB Keyboard">
>                       <merge key="input.x11_driver" type="string">kbd</merge>
>                       <merge key="input.x11_options.XkbSymbols"
> type="string">pc(pc105)+sun_vndr/usb(sun_usb)+pc(pc105)+us(intl)</merge>
>               </match>
>               </match>
>       </device>
> </deviceinfo>
>
> and it seems to work since hal-device list this:
>
> 17: udi = '/org/freedesktop/Hal/devices/usb_device_430_a2_noserial_if0'
>  usb_device.device_class = 0  (0x0)  (int)
>  usb_device.device_subclass = 0  (0x0)  (int)
>  usb_device.device_protocol = 0  (0x0)  (int)
>  usb_device.is_self_powered = false  (bool)
>  info.udi = '/org/freedesktop/Hal/devices/usb_device_430_a2_noserial_if0'
>  (string)
>  usb_device.can_wake_up = true  (bool)
>  info.subsystem = 'usb'  (string)
>  freebsd.driver = 'ukbd'  (string)
>  usb_device.max_power = 100  (0x64)  (int)
>  info.product = 'Type 7 USB keyboard'  (string)
>  freebsd.unit = 0  (0x0)  (int)
>  usb_device.num_interfaces = 1  (0x1)  (int)
>  usb_device.num_ports = 0  (0x0)  (int)
>  usb_device.speed = 12  (double)
>  usb_device.speed_bcd = 4608  (0x1200)  (int)
>  usb_device.version = 2  (double)
>  info.vendor = 'Sun Microsystems'  (string)
>  usb_device.product_id = 162  (0xa2)  (int)
>  usb_device.vendor_id = 1072  (0x430)  (int)
>  usb_device.device_revision_bcd = 512  (0x200)  (int)
>  usb_device.serial = ''  (string)
>  usb_device.product = 'Type 7 USB keyboard'  (string)
>  usb_device.vendor = 'Sun Microsystems'  (string)
>  info.category = 'input.keyboard'  (string)
>  info.bus = 'usb'  (string)
>  usb.interface.number = 0  (0x0)  (int)
>  info.capabilities = { 'input', 'input.keyboard' } (string list)
>  usb.interface.class = 3  (0x3)  (int)
>  usb.interface.subclass = 1  (0x1)  (int)
>  usb.interface.protocol = 1  (0x1)  (int)
>  usb.interface.description = ''  (string)
>  freebsd.device_file = '/dev/ukbd0'  (string)
>  usb.freebsd.devname = 'ukbd0'  (string)
>  input.device = ''  (string)
>  input.x11_driver = 'kbd'  (string)
>  input.x11_options.XkbSymbols =
> 'pc(pc105)+sun_vndr/usb(sun_usb)+pc(pc105)+us(intl)'  (string)
>  usb_device.bus_number = 3  (0x3)  (int)
>  usb_device.level_number = 3  (0x3)  (int)
>  info.parent =
> '/org/freedesktop/Hal/devices/usb_device_430_a2_noserial'  (string)
>  usb_device.port_number = 4  (0x4)  (int)
>  usb_device.configuration = ''  (string)
>  usb_device.configuration_value = 1  (0x1)  (int)
>  usb_device.num_configurations = 1  (0x1)  (int)
>
> I've added the same fdi for "AT Keyboard", when I start X i got this:
>
> (==) RandR enabled
> (II) Initializing built-in extension MIT-SHM
> (II) Initializing built-in extension XInputExtension
> (II) Initializing built-in extension XTEST
> (II) Initializing built-in extension XKEYBOARD
> (II) Initializing built-in extension XINERAMA
> (II) Initializing built-in extension XFIXES
> (II) Initializing built-in extension RENDER
> (II) Initializing built-in extension RANDR
> (II) Initializing built-in extension COMPOSITE
> (II) Initializing built-in extension DAMAGE
> (II) Initializing built-in extension XEVIE
> (II) AIGLX: Loaded and initialized /usr/local/lib/dri/swrast_dri.so
> (II) GLX: Initialized DRISWRAST GL provider for screen 0
> (II) config/hal: Adding input device Type 7 USB keyboard
> (II) LoadModule: "kbd"
>
> (II) Loading /usr/local/lib/xorg/modules/input//kbd_drv.so
> (II) Module kbd: vendor="X.Org Foundation"
>       compiled for 1.5.3, module version = 1.3.2
>       Module class: X.Org XInput Driver
>       ABI class: X.Org XInput driver, version 2.1
> (**) Type 7 USB keyboard: always reports core events
> (**) Option "Protocol" "standard"
> (**) Type 7 USB keyboard: Protocol: standard
> (**) Option "AutoRepeat" "500 30"
> (**) Option "XkbRules" "xorg"
> (**) Type 7 USB keyboard: XkbRules: "xorg"
> (**) Option "XkbModel" "pc105"
> (**) Type 7 USB keyboard: XkbModel: "pc105"
> (**) Option "XkbLayout" "us"
> (**) Type 7 USB keyboard: XkbLayout: "us"
> (**) Option "CustomKeycodes" "off"
> (**) Type 7 USB keyboard: CustomKeycodes disabled
> (II) XINPUT: Adding extended input device "Type 7 USB keyboard" (type: KEYBOARD)
> (II) config/hal: Adding input device USB Mouse
> (II) LoadModule: "mouse"
>
> (II) Loading /usr/local/lib/xorg/modules/input//mouse_drv.so
> (II) Module mouse: vendor="X.Org Foundation"
>       compiled for 1.5.3, module version = 1.4.0
>       Module class: X.Org XInput Driver
>       ABI class: X.Org XInput driver, version 2.1
> (**) USB Mouse: Device: "/dev/sysmouse"
> (==) USB Mouse: Protocol: "Auto"
> (**) USB Mouse: always reports core events
> (**) Option "Device" "/dev/sysmouse"
> (==) USB Mouse: Emulate3Buttons, Emulate3Timeout: 50
> (**) USB Mouse: ZAxisMapping: buttons 4 and 5
> (**) USB Mouse: Buttons: 9
> (**) USB Mouse: Sensitivity: 1
> (II) XINPUT: Adding extended input device "USB Mouse" (type: MOUSE)
> (II) USB Mouse: SetupAuto: hw.iftype is 4, hw.model is 0
> (II) USB Mouse: SetupAuto: protocol is SysMouse
> (II) config/hal: Adding input device AT Keyboard
> (**) AT Keyboard: always reports core events
> (**) Option "Protocol" "standard"
> (**) AT Keyboard: Protocol: standard
> (**) Option "AutoRepeat" "500 30"
> (**) Option "XkbRules" "xorg"
> (**) AT Keyboard: XkbRules: "xorg"
> (**) Option "XkbModel" "pc105"
> (**) AT Keyboard: XkbModel: "pc105"
> (**) Option "XkbLayout" "us"
> (**) AT Keyboard: XkbLayout: "us"
> (**) Option "CustomKeycodes" "off"
> (**) AT Keyboard: CustomKeycodes disabled
> (II) XINPUT: Adding extended input device "AT Keyboard" (type: KEYBOARD)
> (II) 3rd Button detected: disabling emulate3Button
>
> It seems to ignore XkbSymols I've added on hal.
>
> I found a workaround that was add following line to .xinitrc:
>
> /usr/local/bin/setxkbmap -rules xorg -symbols
> "pc(pc105)+sun_vndr/usb(sun_usb)+pc(pc105)+us(intl)" &
>
> Using this Sun special keys work fine on my session, but I believe it's
> not the correct way to have things working, am I doing something
> wrong?

You're mixing XKB rules (rules, model, layout, variant, options) and
components (keycodes, types, compat, symbols, geometry)
specifications. The xserver only operates on the rules specifications,
unlike setxkbmap, which handles both.

I think you can get roughly the same thing by specifying XkbLayout
"us(intl)+sun_vndr/usb(sun_usb)". Play around with "setxkbmap -print"
and various options to -rules/-model/-layout/-variant/-options to see
if you can recreate the settings. Otherwise, you might want to open a
bug on xkeyboard-config to see if there's an existing ruleset that can
be fixed to arrive at those settings.

--
Dan



More information about the xorg mailing list