Opened 17 years ago

Closed 4 years ago

#7556 closed feature request (fixed)

SDL: Remap joystick buttons via scummvmrc

Reported by: SF/pwigren Owned by: ccawley2011
Priority: low Component: Ports
Version: Keywords:
Cc: Game:


Right now the joystick buttons are hardcoded in the SDL backend. This makes it impossible to play many games with a joystick/gamepad.

For example Simon the Sorcerer requires you to press "Y" to quit, or press enter to save a game. Monkey Island Sega-CD requires you to press the keyboard arrow keys in dialogues, which aren't mapped by default.

Ticket imported from: #1679819. Ticket imported from: feature-requests/372.

Change History (5)

comment:1 by fingolfin, 17 years ago

Priority: normallow

comment:2 by fingolfin, 17 years ago

Personally, I'd prefer dropping the joystick code over extending it -- those games never were meant to be played with a joystick in the first place. But that's just my personal feeling.

Given that there are joysticks with only 2 or three buttons, it's not possible to perform a full mapping of all controls in all cases. So if we wanted to allow all games to be fully controllable via joysticks, we'd have to jump through all sorts of hoops, and add code which remaps the buttons on the fly in every scene of the game, etc..

Even if we assume that the joystick has, say, 6 buttons, we would have to add code into the backend which changes the mapping based on the active engine/game. A trick which some backends already use, but which is not nice at all. Backends should ideally be completly independant from the game running atop them; this is currently not the case, which makes life a lot more complicated for porters, who have to own all games to be able to test them and add code specific to those game. A better solution would be to add an API to OSystem which allows engines to specify "important" keys, and then let backends automatically map those keys to appropriate buttons. This is only a vague idea of course, one would have to make sure the mapping obtained this way is consistent across devices, and ideally also across platforms (as much as possible, at least).

comment:3 by SF/pwigren, 17 years ago

That's a bit drastic.. The games are perfectly playable with an analogue gamepad. The only thing I need is to map some buttons or axis as "Y", "enter" and/or keyboard arrows. Almost all gamepads you can buy for the last 10 years have at least 6 buttons. Most have 10 or more, and two or even three axises.

comment:4 by csnover, 7 years ago

Component: Ports

comment:5 by ccawley2011, 4 years ago

Owner: set to ccawley2011
Resolution: fixed
Status: newclosed

This is now possible using the keymapper.

Note: See TracTickets for help on using tickets.