joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.83k stars 383 forks source link

Joystick/Mouse emulation in guest by using host keyboard #3251

Open Torinde opened 2 years ago

Torinde commented 2 years ago

Code of Conduct & Contributing Guidelines

Have you checked that no other similar question(s) already exists?

Question

For Chaos Engine second player requires a Joystick. I tried using the Mapper editor to bind WASD (host) to Joystick X/Y (guest). After putting "2axis" in dosbox-x.conf the "Joystick" got recognized by the setup of the game. But the calibration doesn't work: 'Go up and left and press fire' - whatever 'axis'-keys I press the values for up/left stay around 200-something. Whatever 'joystick button'-keys (joy1 buttons 1 or 2, joy2 buttons 3 or 4) I press - calibration doesn't proceed to "down and right".

Obviously the notion of "corner calibration" doesn't match with WASD keys... but I assumed it will be something like "if you press W+A 10 times for top-left, then each press of a key gives 10% of axis+".

When trying to play the game regardless - when the joystick player has to choose characters - none of the keys do anything (but maybe that's because the calibration/buttons selection setup wasn't completed).

Most of the Wiki pages and Issues I found deal with the reverse situation (using host joystick and emulating keyboard input in the guest).

What am I doing wrong?

Using 0.83.21 64-bit SDL2 win10

Torinde commented 2 years ago

@aybe I see you have experience and knowledge about the joystick emulation, can you give me some advise?