New input system

I’m working on a new input system for SDL.
You can find my work so far here:
http://sites.google.com/site/pixelatedalien/Home/INP.7z?attredirects=0&d=1

This is nowhere near ready yet. In fact, when you run the test
program, it quickly floods the event queue when creating a keyboard
device then aborts the device creation. This is because of too many
control added events when adding the keyboard keys as separate
controls. You should be able to see how it works though, and even if
you don’t like the idea of having a separate object for each
individual control, the device/control list functions should still be
useful for getting hotplugging up and running.

I’m posting this now because I will not have internet access for a
while. I intend to continue working on this when I get a chance, but
for now, I’m out of time.
Unfortunately, this still lacks SDL_PARANOIA, though some additional
checks are enabled by defining INP_PARANOID.

This is built on top of SDL, for the moment, instead of internal. My
plan is to use the input system built on top of the old input system
until it’s implemented on each platform. For example, if Win32 has
been converted to the new system, but X11 has not, then X11 would use
this general implementation, while Win32 would use the Win32
implementation.

Out of curiosity, how far did you get with this? Did you like what you
ended up with?On Fri, Nov 13, 2009 at 11:33 PM, Kenneth Bull wrote:

I’m working on a new input system for SDL.
You can find my work so far here:
http://sites.google.com/site/pixelatedalien/Home/INP.7z?attredirects=0&d=1

This is nowhere near ready yet. In fact, when you run the test
program, it quickly floods the event queue when creating a keyboard
device then aborts the device creation. This is because of too many
control added events when adding the keyboard keys as separate
controls. You should be able to see how it works though, and even if
you don’t like the idea of having a separate object for each
individual control, the device/control list functions should still be
useful for getting hotplugging up and running.

I’m posting this now because I will not have internet access for a
while. I intend to continue working on this when I get a chance, but
for now, I’m out of time.
Unfortunately, this still lacks SDL_PARANOIA, though some additional
checks are enabled by defining INP_PARANOID.

This is built on top of SDL, for the moment, instead of internal. My
plan is to use the input system built on top of the old input system
until it’s implemented on each platform. For example, if Win32 has
been converted to the new system, but X11 has not, then X11 would use
this general implementation, while Win32 would use the Win32
implementation.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and CEO, Galaxy Gameworks

I kinda lost track of it for a while. What I’ve got there covers the
basics though.

I think the next thing on the list was to patch SDL so that it grows
the event queue when full and shrinks it again if the extra space has
gone unused long enough and/or skip the control and device creation
events when starting up. I like the idea of using the events to
initialize the applications view of available devices though, since it
means the same code the application uses for hotplugging would handle
initialization as well.

I was also debating whether or not to use a root device and a device
tree, or keep it one level of devices and one level of controls.
((((Axes on joystick) and buttons) on gamepad) on root device) vs.
(((axes and buttons and joystick composite control (which refers to
axes)) on gamepad) in device queue).On 13 February 2011 03:50, Sam Lantinga wrote:

Out of curiosity, how far did you get with this?? Did you like what you
ended up with?

Also, locks…On 13 February 2011 09:10, Kenneth Bull <@Kenneth_Bull> wrote:

On 13 February 2011 03:50, Sam Lantinga wrote:

Out of curiosity, how far did you get with this?? Did you like what you
ended up with?

I kinda lost track of it for a while. ?What I’ve got there covers the
basics though.

I think the next thing on the list was to patch SDL so that it grows
the event queue when full and shrinks it again if the extra space has
gone unused long enough and/or skip the control and device creation
events when starting up. ?I like the idea of using the events to
initialize the applications view of available devices though, since it
means the same code the application uses for hotplugging would handle
initialization as well.

I was also debating whether or not to use a root device and a device
tree, or keep it one level of devices and one level of controls.
((((Axes on joystick) and buttons) on gamepad) on root device) vs.
(((axes and buttons and joystick composite control (which refers to
axes)) on gamepad) in device queue).

I’ll make a mouse device and disable the keyboard device so there’s a
usable demo.On 13 February 2011 10:10, Kenneth Bull <@Kenneth_Bull> wrote:

Also, locks…

Okay, I was just curious. It’s too close to 1.3 wrapup to be changing the
input model, but it looked interesting.On Sun, Feb 13, 2011 at 7:59 AM, Kenneth Bull wrote:

On 13 February 2011 10:10, Kenneth Bull wrote:

Also, locks…

I’ll make a mouse device and disable the keyboard device so there’s a
usable demo.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and CEO, Galaxy Gameworks