Hi input system architects,
I wonder how exactly connected devices are connected with the available
event handlers like keybdev, mousedev, and joydev, and whether it is
influence this decision.
From the Linux kernel sources I can see that new device instances are
registered by their driver, e.g. from hid.c or stinger.c, with the input
system by means of input_register_device(). This function then calls
the connect() function of any available event handlers such as keybdev,
mousedev, and joydev which decide whether they want to receive and handle
the input device's events. Every event received from an input device is
posted to all event handlers which are registered for this input device.
So far so good. But what if I have one USB HID device for which I want
a different handler than keybdev, mousedev, and joydev to be used?
For example, I have a "normal" USB keyboard that is handled by keybdev,
which is fine, but then I have an additional USB HID keyboard, a small
number pad (an add-on keyboard meant for faster data entry on notebooks),
for which I would like to use a handler module of my own to make it
generate different keystrokes (i.e. use a different translation table)
or even gamepad events.
Is this possible? How is the order determined in which the connect()
function of the handlers are called? Can a handler "eat up" an event so
that it is not presented to handlers which are later on in the chain?
Thank you,
Arndt
|