Last summer I went down to the local GoodWill computer store and
bought a bag full of mice, keyboards, and joy(devices). I did that
because I was planning to work on the multidevice support in X for SDL
1.3. Well, the project has been put off and delayed because the X.org
people have been rethinking the same problems.
Their solutions are included in XInput extension 2.0 and in the MPX
(MultiPointer X) extension. These extension are in the X.org 1.7 X
server that was just released a couple of days ago. Over the next 6
months that server should show up in main stream Linux distributions.
XInput 2.0 is supposed to finally do what XInput never did. It is
supposed to provide a generic interface to all interactive devices and
to support true hot plugging with events to tell when a device has
been plugged in and when one has been removed. MPX is supposed to
solve several problems with touch screen input and to allow multiple
mice to control multiple separate screen pointers. It allows a
keyboard and a mouse to be bound together so that several people all
using their own mice and keyboards can share a single screen with each
person being able to point and click and type with their own input
devices.
Now that we will soon be able to do all these things it seems like a
good time to talk about the changes needed in SDL to support the new
capabilities for input that we are now in the major operating systems.
A few obvious questions:
- Can the existing SDL multitouch interface for the iPhone be adapted
to the other major OSes? - I believe be need device added and device removed events. Do we
really? And if so, how to we squeeze them in? What information must
the contain? - Joysticks versus everything else. Right now the joystick API is
different from the mouse/keyboard API. There are very good reasons for
that. Are those reasons still valid? Can we (should we even try) to
create a single device API for all input devices? - Weird devices: When I run “xinput --list” I see that the current
XInput extension considers the power button to be a keyboard. In fact,
it finds two of them and I can only find one! I suspect that the new
XInput is going to also see, and expose, lots of other odd devices.
What, if anything, should SDL do about those? I might really want to
get an event telling me the power button has been pushed…
What do the other major and minor OSes do about weird devices,
joysticks, and hot plugging? I’ve only been looking at X so I would
like to get feed back about how this is handled on Window and Mac OS X
and other OSes.
Bob Pendleton–
±----------------------------------------------------------
- Bob Pendleton: writer and programmer
- email: Bob at Pendleton.com
- web: www.TheGrumpyProgrammer.com