VOGONS


First post, by Pickle

User metadata
Rank Member
Rank
Member

If I was to create a patch that would allow SDL joystick buttons to mapped to internal dosbox keys, would there be support to add it to the mainline code?
My plan is to analyze the existing code for mapping SDL keyboard keys and create a similar mechanism for SDL joystick buttons.

mapper.txt example:
key_a "key 111"
btn_1 "key 112"
btn_2 "key 113"

If I can get the support from dosbox authors that if I do this feature in a way they approve that it could be added to cvs I would be ready to get started on it.

The need for such a solution would mainly benefit devices that do not have support for a full keyboard. (We do have something already for the GP2X, but it is very bad hack, and this would be a much better solution)
This could be useful for machines that do have a full keyboard. It would give joystick support to all the games that only have keyboard support.

Last edited by Pickle on 2008-09-25, 13:35. Edited 1 time in total.

Reply 3 of 10, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Readme should have an example. Basically you can remap buttons/axes
to keys and back. Just be sure you set joysticktype= to something sensible
(that is NOT auto if you don't have a joystick attached).

Reply 4 of 10, by Pickle

User metadata
Rank Member
Rank
Member

ok i see it in the readme:

Examples about remapping the joystick: You have a joystick attached, it is working fine under DOSBox and you want to play so […]
Show full quote

Examples about remapping the joystick:
You have a joystick attached, it is working fine under DOSBox and you
want to play some keyboard-only game with the joystick (it is assumed
that the game is controlled by the arrows on the keyboard):
1) Start the mapper, then click on one of the arrows in the middle
of the left part of the screen (right above the Mod1/Mod2 buttons).
EVENT should be key_left. Now click on Add and move your joystick
in the respective direction, this should add an event to the BIND.
2) Repeat the above for the missing three directions, additionally
the buttons of the joystick can be remapped as well (fire/jump).
3) Click on Save, then on Exit and test it with some game.

Does anyone remember the actual syntax for the mapper.txt?

Reply 6 of 10, by Pickle

User metadata
Rank Member
Rank
Member

yeah I will have to do that later.

When was this feature added in, do you remember?
I wonder because if this existed before why the original person hacked the GP2X the way they did, basically turning the GP2X keys events into SDL keyboard events. I assumed since they did it that way dosbox didnt support this kind of action, if I remember right I think the first GP2X port was back during the 0.63 version, but thats a guess.

Reply 8 of 10, by Pickle

User metadata
Rank Member
Rank
Member

ok, i tried it out on a pc with a usb joystick and its sort of of the right idea but its limited to 4 buttons, anything above 4 gets mapped from 0-4.
I can understand the desire to limit the virtual joystick to 4 buttons, but should there really be any limit to an external real joystick used?

Reply 10 of 10, by Pickle

User metadata
Rank Member
Rank
Member

thanks for that, it looks like im not doing a very good job at reading the doc's 😒
I didnt find anything in the readme, but I find this in the dosbox.conf.

# buttonwrap -- enable button wrapping at the number of emulated buttons.