[Xorg] Input device hotplug
Jon Smirl
jonsmirl at yahoo.com
Wed Jun 23 10:47:28 PDT 2004
On Linux 2.6 you can put an executable in /etc/hotplug.d/input and it
will be run whenever a new device is add/removed. The program/script
could check if xserver is running and tell it about the new device.
This doesn't work for PS/2 devices right now but that is a known
problem and on the queue to be fixed.
--- Kristian_Høgsberg <krh at bitplanet.net> wrote:
> Hi all,
>
> I've been working on making the X.org server hotplug aware with
> respect
> to input devices. The current situation is that all devices must be
> setup in the config file and adding new devices requires config file
> editing and server restart. What I've been trying to implement is
> that
> you can plug in an input device while the X server is running and it
> will show up as a new XInput device.
>
> The overall design I'm thinking of is to keep the device discovery
> mechanism out of the X server. By adding requests to add and remove
> devices a client program can monitor hotplug events and tell the
> server
> to add or remove devices accordingly.
>
> I have a prototype running were I've added AddInputDevice() and
> RemoveInputDevice() in the XFree86-Misc extension:
>
> typedef struct {
> char* name;
> char* value;
> } XF86MiscDriverOption;
>
> Status XF86MiscAddInputDevice(Display *dpy,
> const char *identifier,
> const char *driver,
> XF86MiscDriverOption *options,
> int option_count);
>
> Status XF86MiscRemoveInputDevice(Display *dpy,
> const char *identifier);
>
> i.e. the AddInputDevice arguments correspond to the InputDevice
> section
> of the config file. The implementation mimicks the server
> initialization sequence; it loads the driver, builds an option list
> from
> the given options, calls PreInit(), and adds the device.
>
> In the prototype I'm using HAL (hal.freedesktop.org) on Linux to
> enumerate and discover devices. Other systems could use other
> mechanisms, but HAL is intended to be cross platform, and a FreeBSD
> port
> is being discussed right now on the list.
>
> One thing I'ld like to discuss is where to add the add and remove
> device
> interface -- I dont think XFree86-Misc is the right place. My first
> approach to this was that the new functionality should be an Xorg
> private interface, but I'm thinking that maybe it would be better if
> it
> was a standardized extension to XInput. In that case, is the
> proposed
> interface too Xorg specific?
>
> Comments are welcome. I'm currently trying to get my prototype
> cleaned
> up, and then I'll attach it to a bugzilla entry
>
> Kristian
>
>
> _______________________________________________
> xorg mailing list
> xorg at freedesktop.org
> http://freedesktop.org/mailman/listinfo/xorg
>
=====
Jon Smirl
jonsmirl at yahoo.com
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
More information about the xorg
mailing list