Flexible input mapping

I’m writing a game and am having problems working out how to create a
system to allow players to map their joysticks and mice to the
controls of my game.

The way I’d like it is that the players can go to a “configure
controls” screen and assign keys, joystick axes/buttons and the mouse
to various controls my games have. This is mostly so that if you have
one of those Playstation/XBox to USB boxes you can assign the axes and
buttons correctly since they all seem to do it differently, and for
people who don’t have joysticks at all.

I’m not after a ready-made library or anything (unless one exists!),
but a few pointers and ways other people have done it would help a
lot.

Thanks :-)–
http://www.piku.org.uk - Outdoor Photos: http://www.piku.co.uk

James Grimwood wrote:

I’m writing a game and am having problems working out how to
create a system to allow players to map their joysticks and
mice to the controls of my game.

The way I’d like it is that the players can go to a
"configure controls" screen and assign keys, joystick
axes/buttons and the mouse to various controls my games have.

Have a look a VControl – http://hkn.eecs.berkeley.edu/~mcmartin/vcontrol/ .
It cannot currently do mouse input though, and is scheduled to undergo an
overhaul for better controller mapping. At least it can give you ideas on
how to approach your problem.

-Alex.