Opened 12 years ago

Last modified 11 months ago

#7556 new enhancement

SDL: Remap joystick buttons via scummvmrc

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

Description

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 (4)

comment:1 Changed 12 years ago by fingolfin

Priority: normallow

comment:2 Changed 12 years ago by fingolfin

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 Changed 12 years ago by SF/pwigren

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 Changed 11 months ago by csnover

Component: Ports
Note: See TracTickets for help on using tickets.