Input Inconsistency API

= Types =
event.motion.x, event.motion.y: mouse motion
event.jmotion.x, event.jmotion.y: joystick motion
Would be more consistent, elegant and easy to follow to or:

  • move mouse motion to event.mmotion
  • make the event.motion handle any motion input, peripheric independent

= Values =
GetMouseState, GetJoystickAxis coordinates don’t return the same values as
the previous motion events, needs mode resolution compensation. In my
opinion i like better the event.*motion values, easier to guess.

I still need to check for KeyboardState, as to opinate. Mainly event.key
modifier keys as not keys but flags, nice to get a control modifier for a
base key, but nice too to get an actual key for the control key. Repeats
and user track of DOWN/UP of 20 Keys, 20 bools, Layer task. A quick search
shows http://wiki.libsdl.org/SDL_GetKeyboardState , wich seems good :slight_smile: .

= Extras =
A virtual keyboard axis would still be nice for player movement, relative
motion ++, …, but that has it’s own thread ;-P==

Seems stitched together and cumbersome. NONETHELESS, i see it very powerful
and capable for such a vast abstraction of so many input peripherics, kudos
for the work done, really, it gets the things done.

I’ve been researching for an SDL way to get if joystick is analog or
digital,no luck. Cause if joystick is digital i’d just handle the axis as
keyboard curor arrows, if analog i handle it like a mouse pointer ;-). Any
insight on this? Thanks, juanmabc.

The gamecontroller API will come in handy here. SDL doesn’t have any
kind of controller profiles (digital/fighting pad, full function
controller, etc) so there’s no guarantee that a given controller will
have analog sticks, but if axes 0 and 1 get used, you know that they
are at least intended to be used as analog stick. Likewise with the
DPad.

The problem is that the gamecontroller API doesn’t have a way to deal
with situations like the iOS pads that are all analog controls. It
presents something similar to, but legally distinct from, an XBox 360
controller. Triggers may be digital (PS-style controllers), analog
sticks may be absent (SNES game pads), the Guide and Back buttons may
not be present, and at least on Apple the Start button might be a
simulated press and release generated from a single event.

Of course if you need access to things like iOS/PS2 analog buttons or
the non-traditional functions of the Wiimote or something, you still
receive joystick events when using the gamecontroller API. You just
need to figure out which joystick events are bound and ignore what
you don’t care about.

JosephOn Fri, May 16, 2014 at 09:40:34PM +0200, Juan Manuel Borges Ca?o wrote:

I’ve been researching for an SDL way to get if joystick is analog or
digital,no luck. Cause if joystick is digital i’d just handle the axis as
keyboard curor arrows, if analog i handle it like a mouse pointer ;-). Any
insight on this? Thanks, juanmabc.


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