Kerry Shu wrote:
>
>
> Nicolas Williams wrote:
>> On Mon, Jan 12, 2009 at 08:49:56AM -0800, Garrett D'Amore wrote:
>>> I had suggested a similar approach (using keyboard keys) -- actually
>>> my original suggestion went a step further, and suggested that this
>>> module could emulate a USB keyboard and generate USB boot-protocol
>>> HID keyboard events.
>>>
>>> However, the problem, as I understand it, is that as rich as the USB
>>> spec is, there are still some keys that lack standard keyboard
>>> defines in the USB spec -- e.g. the WLAN toggle key, and LCD
>>> backlight control keys.
>>>
>>> I think the current plan has the X server generate key events (X11
>>> events) so that tools like gnome can operate on them the same way as
>>> ordinary keys. While not as elegant as a lower level emulation
>>> would be, I think it is reasonable.
>>
>> That's fine. What's NOT fine is having to build a kernel module in
>> order to provide a set of mappings. That's really difficult to use. An
>> ioctl() that can take a list of mappings provided by a user-land program
>> that parses a configuration file would be better. And either way there
>> needs to be a mechanism by which it is possible to discover what the
>> actual hotkey keyboard layout is (i.e., "what laptop is this?").
>
> A kernel module, hotkey driver, is to init and get the hotkey ACPI
> events. The key mapping is done in Xserver. Xserver maps each hotkey
> with same "keycode + modifier" no matter what laptop is.
> For your suggestion, we still need to define different unused keycode
> for each hotkey in configuration file. Anyway, per my understanding,
> we can hardly find enough unused keycode for them. (Henry can comment
> more). And it's also platform dependent.
Yes. Kerry describes the general picture how mapping is done in X
server. Since
not enough unused keycode(s) are available, we use "transit mapping"
method in
which the same keycode (in the current design, it is 127, which is not
being used)
and modifier are used for all possible keysysms (events), a mapping to
a desired
keysym is made prior to key/modifier posting, and an unmapping made after.
>
> Regards,
> Kerry
>
>>
>> Nico