Input device hotplug solution

Aivils Stoss aivils at latnet.lv
Thu Feb 2 23:08:52 PST 2006


Control extension for X windows.

    Main goal of this package is input device hotplug. Here
is nothing special. Just X server start-up routines adapted
to runtime case. Input device cannot be created without proper
device driver. xmodule prepared for driver module loading.
Correct input driver fit for hotplug without touch to source.
At least mouse, evdev current (FEB-2006) input drivers support
module load/remove and device create/delete.

INSTALL

Please edit in the Rules.make line SERVER_SRC, insert here path to
Your server source. It is _not_ server compile from scratch. All what
You need is X server sources for suitable header files. Some
important variables current X does not export as symbols. These
variables are taken from Xorg binary during compilation.

# make
# make install

For xmodule and xdevice usage X server must load control extension.
Please edit Your xorg.conf file. Part of xorg.conf file:
Section "Module"
    <skip>
    Load "control" # Support of xmodule and xdevice
    <skip>
EndSection

XMODULE

        xmodule application prepared for manipulation with
server modules. Supported options:
# xmodule -l name,option1,value1,option2,value2,...
-l - load the module of X server,
name - module name, current it may contain absolute path 8-(
option1 - option name,
value1 - value of option1

# xmodule -r name
-r - remove the module of X server.
# xmodule --list
receives list of some registered modules.
# xmodule --list-input
receives list of registered input modules and print it to stdout.
# xmodule --list-output
receives list of registered input modules and print it to stdout.

XDEVICE

        xdevice application allow runtime device create/delete
alias "hotplug". If driver module is not loaded in server then
You may need to use xmodule.
# xdevice -c ident-name,driver-name,option1,value1,option2,value2...
-c - create input device,
ident-name - input device identifier,
driver-name - driver name,
option1 - option name,
value1 - value of option1.
Command equals config entry like this:
Section "InputDevice"
    Identifier "ident-name"
    Driver "driver-name"
    Option "option1" "value1"
    Option "option2" "value2"
EndSection

Double Quotes are supported. Backslash must be used to prevent
bash remove double quotes. Inside double quotes metacharacters
'\n' '\b' '\r' '\t' '\f' and octal \0XXX and hexadecimal \0xXX
values are converted and separator ',' is simple comma.

# xdevice -c e4,evdev,Device,\"/dev/input/event4\"

# xdevice -d ident-name
-d - deletes device with identifier "ident-name"

Probably You will create new device under Linux, which uses
driver evdev and device file /dev/input/event4. Commands:

# xmodule -l evdev
# xdevice -c e4,evdev,Device,/dev/input/event4,AlwaysCore,1

Check out input devices
# xsetpointer -l

Delete previously created input device
# xdevice -d e4
# xmodule -r evdev
Module removing is not certainly required.

Aivils Stoss

You are welcome to create output driver hotplug :o)

http://www.ltn.lv/~aivils/files/xdevice-0.01.tar.bz2



More information about the xorg mailing list