-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, 11 Nov 2002 14:43, Zephaniah E. Hull wrote: > On Mon, Nov 11, 2002 at 11:55:00AM +1100, Brad Hards wrote: > > On Mon, 11 Nov 2002 10:43, Alexander Stohr wrote: > > > > This patch (attached) add support under Linux for talking to mice > > > > directly from the event interface, IE, /dev/input/event<n>. > > > > > > > > It is stashed as a os specific protocol, evdev, the Device > > > > option is not > > > > a device, but instead is the device name, such as > > > > 'A4Tech USB Optical Mouse'. > > > > > > > > It has some limits, specificly if you unplug a USB mouse and plug it > > > > back in you have to cause it to be deactivated and reactivated, a > > > > good way of doing that is to change VTs away from X, and then change > > > > back. > > > > > > > > Also if you have two identical mice with the same label it is > > > > somewhat indeterminate which you will get, this could be improved. > > > > > > If i do remember right i have seen an USB mice that provides > > > a serial number trough its device information which uniqely identifies > > > it. Sorry if i am wrong for this - its just what i thought i have seen > > > there. > > > > Serial numbers are optional for USB devices (and most mice don't have > > such a thing). Also, some devices have them, but they are not unique > > (this is against spec). The name that comes back from EVIOCGNAME may not > > have meaningful text either, since some mice don't have any strings. You > > may get a null string, depending on the mouse type (won't happen on USB - > > you'll get the vendor and product IDs instead). > > > > There is really only one unique identifier that is reliably useful: the > > physical path, as returned by EVIOCGPHYS. For example, there will always > > be one device like this: usb-00:01.2-2.1/input0 > > Hmm, obviously this makes my current identification method rather > suboptimial. Depends on the problem we need to solve. If the machine only has one of each device, then it doesn't matter where it is plugged in, and we can use EVIOCGNAME or EVIOCGID.
If the machine is multi-headed, then perhaps the physical path will be better. > What about using the bus, vendor, product, and version tags? (Returned > by EVIOCGID) That isn't different to using the strings on USB, except for the odd case where the string just says "mouse" or something silly. > The main catch is that I don't have a clue what those would be set to > for ADB or PS2 mice for 2.5.x. They will exist, but may not be unique (same as if you have two identical mice). There is an ioctl() for a unique identifier (EVIOCGUNIQ), but on most devices, it'll return NULL. > > However if you plug it into another port (or you plug another input > > device into that port), you are basically screwed. It'd still be a nice > > option to offer for configuration though. > > > > We still need proper hotplugging though. > > We /can't/ support proper hotplugging under linux because to my > knowledge no interface exists that can tell us that a new device has > been plugged in. Ah, but there is. /sbin/hotplug will be invoked by the linux kernel whenever a new device is attached or an existing device is detached. All the interesting devices can do this. You get the device information as environment variables. /sbin/hotplug is normally a script, but it can be anything. Or the script can exec() some other code. See http://linux-hotplug.sf.net > This really sucks, but it is beyond the scope of this patch to try and > make that happen, though it is clearly something that must happen. I see your patch as a first step, and one that is very welcome. Next thing would be to generalise the interface to work for a keyboard. > (I have some thoughts on what might work, but they seem USB specific.) Unfortunately /sbin/hotplug is Linux specific. I don't know if the *BSD guys have something similar. Brad - -- http://linux.conf.au. 22-25Jan2003. Perth, Aust. I'm registered. Are you? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9zy5BW6pHgIdAuOMRArDPAKCBvm8h98Esn1l3pfnOwsud21JESgCdEzQA tPZkMLNgzrw/V6SZBNMr/aE= =AbD5 -----END PGP SIGNATURE----- _______________________________________________ Xpert mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/xpert
