[Scummvm-devel] Joystick code

Marcus Comstedt marcus at mc.pp.se
Wed Sep 10 13:41:40 CEST 2003


Max Horn <max at quendi.de> writes:

> The question is: how to do that, exactly. One way would be to add an
> event type for joysticks, and remove any "keyboard-mouse" handling
> code from backends (do any backends besides the SDL backend do that
> anyway?).

The Dreamcast backend does remapping from joypads to keyboard and
mouse events.  The trouble with remapping is that it is dependant on
both the input set of events you have to work with (i.e. the number of
buttons on joypad etc) and on the output set of events that are
meaningful to the particular game/engine.  For example, the keyboard
events I map various joypad buttons to are selected to be useful with
SCUMM games, but might be totally useless with other engines.  Making
a central remapping facility might provide a more scalable way of
handling engine or even game specific mappings.  OTOH, the remapper
needs to know about the hardware to be able to select a good mapping.
For instance, the standard Dreamcast joypad does not have enough
buttons to be able to map 9 buttons for the boxing sequence in Indy.
Therefore, these keyboard events are mapped to "chords".  On a
controller with two D-pads (supported by the Dreamcast, but not very
common) it might make more sense to dedicate one of them to boxing,
with a button for the ninth "direction".


  // Marcus






More information about the Scummvm-devel mailing list