Re: [AD] pressure support

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2010-02-21, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> On 21 Feb 2010, at 9:14 , Elias Pschernig wrote:
> 
> > If we had support for generic input devices for everything besides
> > keyboard, mouse and joystick, it means when coding a game what I have to
> > do is:
> > 
> > - check keyboard
> > - check mouse
> > - check joysticks
> > - check other devices
> > 
> > This is hard enough, but at least a finite task - I don't have to hunt
> > the documentation for each possible event and input devices, which in
> > the end is just a rename of the joystick buttons/axis we already have.
> 
> Well, one thing is clear: we cannot have special events for all types of
> input peripherals out there. There's too many, and new ones get introduced
> all the time. So we do need to draw the line somewhere.
> The question is how cleanly things map onto a "generic" input device.
> We may need to strike a balance between "generic" and "particular". From a
> generic point of view, a rotation gesture or the pressure at the tip of a pen
> may be two very similar things: it's an event with an associated floatint
> point value (to indicate the amount of rotation, respectively the pressure on
> the tip of the pen). If I'm looking for a generic control scheme where I
> could replace one with the other, it makes sense to treat them the same
> (forgetting for the moment that pressure on a stylus probably comes with a
> pointer location value and a rotation gesture doesn't).
> On the other hand, if I'm writing a program with the explicit intention of
> using a stylus (or a rotation gesture) as an input method, then such a
> generic interface is confusing and annoying.
> I guess you're arguing from the first point of view whereas I'm more arguing from the second.

Imagine trying to write a simple text field with a generic event source instead
of a keyboard event source.  When the user presses a key, you get a button_down
event with button_number=67.  Then you have to figure out what letter that is
supposed to produce, but then you have to take into account shift states,
accents and input method, while the OS already does that.  When the user
holds down the key, you get no repeat events either.

So, while there are sometimes advantages to treating all input devices as the
same, it's not always the case.

> Anyway, I'd be happy with a keyboard/mouse/gamepad/other identification
> scheme if we can come up with a nice way to do it (and I don't think mapping
> things like rotation and pressure to an "axis" is it), even if "other" is
> really another name for "sortof gamepad".
> 
> > Yes, my thinking is, we provide keyboard, mouse and joystick in Allegro.
> > And map everything else to generic devices (and not one of those three).
> 
> Ok.

We could even lump joysticks into "generic inputs" as the joystick API is
already quite general.

> > That's just a naming issue then. We can call both "action" with a
> > floating point value. A button would then simply set it to 0 or 1 and an
> > axis work like now.
> 
> I like that better.

There should be a flag at least to indicate whether its a button or axis.

> > Yes, it sure would be nice to have both. If you register a generic input
> > device, you get generic events (say when coding the input config
> > screen). But if you register a mouse or keyboard (or even gesture
> > source) then it works with a hard-coded API.
> > 
> > In practice, I don't think I'm up right now to code that in though...
> > writing mails here about it is probably as much as I have time for.
> 
> I hear you. ;)
> I don't think this needs to make it into 5.0, however - as long as 5.0 has
> something that we're all reasonably happy with. Afterall, we need to have
> something to put in 5.2 or there'd be no reason to continue development after
> 5.0 is reached (and in fact, 5.0 will never be reached).

Agreed.

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/