Hi,
I was looking into letting the X server be happy no matter when
the mouse is pluged in (before or after it is started) or even
unplugged and plugged in again.
If you tell the server layout about a good handfull of mice
/dev/input/mouse[0..9] for example
InputDevice "VoidMouse" "CorePointer"
InputDevice "Mouse0"
InputDevice "Mouse1"
InputDevice "Mouse2"
you can use xsetpointer to switch to the mouse for your screen
eg use a hotplug script.
so when you plug a mouse in, hotplug will use xsetpointer for
appropriate display to switch to the mouse
(use the "void" input driver when no mouse, and probably
as the the core mouse in config, and switch to correct mouse
if its available once running)
Now all this works fine in theory, bar one problem i'd like some
help on. X only looks at what inputdevices are available:
- When it starts
- When you switch to and then from the console (ctrl+alt+f#)
so switching to a mouse that was plugged in after these event
(in this case xsetpointer will only see it if you allowmouseopenfail)
is no good it dont move, unless you do a console switch afterwards.
XListInputDevices() as use by xsetpointer will not show devices that
failed to open at the two times (as said above) when X looks, unless
you use the AllowMouseOpenFail option
XOpenDevice() seem to stay quiet when you open a device, while useing
AllowMouseOpenFail and the device was not there last check, it doesn't
even bother looking again =/
It obvious to me that underlaying design of XF can tolerate inputdevices
coming and going, what i been looking for is some function call, or code that
will cause X to recheck what input devices it has on demand, not just in the
two case above.
inside the XFree86 binary there is this code
from: xc/programs/Xserver/hw/xfree86/common/xf86Init.c InitInput()
...
pInfo = xf86InputDevs;
while (pInfo) {
xf86ActivateDevice(pInfo);
pInfo = pInfo->next;
}
...
which i think is whats needed, but these symbols are not available out side of
it. I am not a strong enough coder at the mo and would like help tampering with
it. also i not yet found a way to connect gdb to an X running on some machine
as it, without nasty things happening.
(yes I know about evdev, humor me if you can help)
Thank you.
Thorben
PS Although I am not on this list, I do read it via the gmane news
gateway (in knode if you care) so you dont need to cc me.
|