Customization of input drivers
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 11 lines · Nathan Conrad
Thanks for your reply. I accidently deleted your message after reading it.
I believe that the following would not be kernel bloat. Currently, the kernel does have keyboard remapping abilities (although I do not know the implementation details). Keyboard mapping _needs_ to be done at the kernel level because of the console layer. I need to be able to type with the dvorak layout soon after init is loaded. I do not want to run something like X in order to get a text console. If this remapping was done inside of
input.corevdev.c, this would kill two birds with one stone: keyboard re-mapping and mouse event re-mapping.
Well, no again. Keyboard remapping is done in keyboard.c (and not in the input core) for a very good reason - the input core maps the hardware-dependent scancodes to linux input event keycodes, which are the same on every platform. Thus you can have the same keymap loaded into keyboard.c to use the dvorak layout on a Sun, PC, Amiga, Mac, etc.
Quoted 2 lines
Mouse mapping is not strictly needed here. It is just a nice side effect of moving mapping into
input.c
But if you do it in userspace, you can also do all the nice gesture stuff and sliders at the edge of touchpads and ... which you wouldn't be able to do in the kernel generically enough and still pass the bloat measure.
Quoted 11 lines
Perhaps two mappings would be necessary: one for the scan
codes->linuxkeycodes (which would be in the keyboard's driver) and another for linuxcodes->inputevents.Quoted 6 lines
I like for the left button sends a
BTN_MIDDLEevent while the touchpad sendsBTN_TOUCH. Is there a map somewhere that can change these button mappings at runtime? Looking atmousdev.c, theBTN_TOUCH,BTN_LEFT, andBTN_0all send a mouse-0 event to the mouse device.... I would like for my driver to be able to send aBTN_LEFTevent when I click the left button and have that converted somewhere into a mouse-1 event.
Quoted 8 lines
The touchpad itself reports when there has been a touch click or a drag. In order for this configuration to be done in userspace, there are two options:
1) report the finger movements and use some complex, time-critical algorithm to determine if the user wants the touch to be translated into holding the mouse button down or if the user wants a click and then to move the mouse or a double click.
Actually time is not critical anymore with input drivers, because we report precise timestamps to the userspace.
Quoted 4 lines
2) Let the hareware handle it, and add some new event such as
BTN_TOUCH_DRAG.I am not sure as to if kernel configuration or the second choice above would be the best.
I quite like option #2. I'd call it BTN_DRAG probably only.
Quoted 9 lines
Quoted 8 lines
Another configuration flag that I would like to export to userspace is if the user wants to be able to use the touchpad to click, and if so, also be able to use a drag-lock. Many people that I know hate these options....
The ABS_* events seem to be directed towards toucdscreens and drawing tablets. Is it the right thing to do to convert to
REL_events inpsmouse.c?
Quoted 8 lines
Now that I think about it, this point seems moot. The psmouse driver is the only place where it would have mattered. It is a hack and should die.
On a side note, I like being able to mix multiple mouse devices. This should be done in gpm, etc.... What is supposed to happen when a device is hot-plugged? Will the hotplug daemon have to restart gpm (and supply the correct arguments) when a device is removed or added?
The hotplug agent (not a daemon, it's executed again on each hotplug event) will do anything you want. Namely it can send a SIGUSR to gpm, or connect to the X socket and explain the existence of a new device via the XFree86-Misc extension.
Quoted 7 lines
On the same Sony laptop, a key sometimes gets stuck down. It is almost always the shift key. The enter key started repeating right after I typed 'sudo halt'. My guess is that the key-release event is getting lost somewhere and the autorepeat (now done in software and not the keyboard that knows the correct state) is doing its job too well. Could you give me some pointers in debugging this? This happens in X and in the console.
There may be a bug in the autorepeat code. I think there is a small race window which can cause the autorepeat continue even after the key is released if the autorepeat timer code is running at the time the key is being released.
I'll try to fix it today and if it still has problems on your machine after that, we'll debug it there.
Quoted 2 lines
Is there a mailing list somewhere to which I should be sending this message?
Signature · 2 lines
Vojtech Pavlik SuSE Labs