Re: Keyboard handling on non-x86

Michael <[email protected]>
Newsgroups gmane.comp.xfree86.devel
Message-ID <20050520143759.1b36e62b@inishowen>
Hello,

> Ideally it should automatically determine when "wscons" mode is
> needed.

Ok, on NetBSD that would be always, none of the pre-wscons ports runs
XFree as far as I can tell. So - some ( like x86 ) might not exactly
/need/ it but they /should/ use it.

> This would be easier to do via the modular XFree86 "keyboard" driver
> than with the built-in "kbd" driver.  See more below.

Yeah, I finally found it - looks MUCH more sane than what I've been
ranting about yesterday. In fact I got it to work pretty well now and I
have a few questions.

> I would suggest following this up via the modular "keyboard" driver.
> Like the mouse driver, it consists of two components: a
> platform-independent input driver module in xfree86/input/keyboard/,
> and an OS-specific portion in xfree86/os-support/platform/.  The
> interface between the two should make it possible to avoid forcing all
> keyboard models into the AT-style mould. 

That's what I'm doing now. When I find a Sun keyboard I simply change
the default xkb settings to rules=sun and model=type4 or type5. Works
pretty well when I disable scancode remapping ( it's still in the
driver... ) - then even the Sun-specific keys work and it can still be
overridden via XF86Config.

> Also, as with the mouse driver, it should be able to automatically
> determine which is the best device/protocol mode to use at run-time.

Agreed.

> If you find any issues with the keyboard driver or the interface
> between the platform-specific and platform-independent components of
> it, this is the place to discuss and resolve them.

What I'm doing right now is to make the keyboard driver use xkb for
scancode->keysym translation, at least for Sun keyboards. This allows
all keys to work and avoids all these AT-scancode quirks. To do that I
leave both the remap function and the scancode translation table at
NULL and set the XKB keymap according to what wskbd tells me about the
keyboard ( sun type4 or sun type 5 ). The wscons support code there has
numerous issues:
- it didn't know about WSKBD_TYPE_SUN5 so initially it tried to use
AT-style scancode translation.
- the mapping between XLEDs and wscons ioctls is wrong. The reason seems
to be the sun keymap which says:

    indicator 4 = "Caps Lock";
    indicator 3 = "Compose";
    indicator 2 = "Scroll Lock";
    indicator 1 = "Num Lock";

... while XFree's map says:

    indicator 1 = "Caps Lock";
    indicator 2 = "Num Lock";
    indicator 3 = "Scroll Lock";

the latter seems to be hard-coded into the driver. 

The driver still attempts to translate everything into AT scancodes
which is a Bad Thing in my opinion, I think the main reason is to catch
special keystrokes like ctrl-alt-backspace before xkb does. Is this
really necessary? Shouldn't xkb handle them correctly?
Wouldn't it be better to select a sane xkb map instead of attempting to
make everything fit a PC keymap?

have fun
Michael
signature.asc (application/pgp-signature, 478 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (NetBSD)

iQEVAwUBQo4uh8pnzkX8Yg2nAQI9bwf9Hir7o3GGBsHJQVCDLQgKOBSfUY7+INNt
4S/DjyI9dgque3tyDZNECfyeuidWuRpjvCUcZozn5eNO2isW8SWG/dcedGwipCC+
RI6+I7MIEgnLHhG2CDcqDLLZ5xoH3HhBlfAMrB6U0LdcK4cM15vcPdLcmzl0mCE3
OIpUEVN5LpOTSXaffESRyRVPj64Qlcwcj5Y24IWdNUy9u64bW5Xy8kEIhSgd02et
ViATD45rM4rgf0I1CoF3u0uF86plN5f85vJLIjjw9Qc3hYwR8NnkAztP2QQToCae
2xNppOKjT2XKdei7wDZtEY8nTdurOMCu3TEijI7afNn1MA6iVbjsDw==
=nr7h
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.