There are a few DOS TSR programs to map a Joystick to a keyboard but not a keyboard to a joystick, this is a real example of mapping a keyboard to a joystick that will be very useful and i don't know how this can be resolved.
I am making a compilation of only MSDOS games that support 3-4 players simultanously (not in turns) ready to play when i meet friends and i have 4 USB gamepads (all are the same model).
I am building this on Batocera, so you can play the games easily selecting them from a friendly menu with the gamepad and all is ready to play.
Batocera uses Dosbox to execute the games.
But I have found a problem with a game that has 4 players support: Dynablaster (Bomberman).
The general idea for every game in my compilation is just map each player keyboard keys (in the case of Dynablaster, only 5 keys are needed for every player: up, down, left, right and fire) to every gamepad (axis/hat and button1), this works well using the mapper that Dosbox has builtin. Every game has its config file for mapping the gamepads to keyboard keys.
But here is the problem: Dynablaster don't use the keyboard for 4 players. It uses keyboard for player 1 and 2, and joystick 1 and 2 for player 3 and 4:
Player1: keyboard
Player2: keyboard
Player 3: Joystick 1
Player 4: Joystick 2
I can map player1 and player2 from my USB gamepad to a keyboard (using the mapper that Dosbox has), so the game receives keys pressings but the problem it's with player3 and player4.
The solution will be: a DOS TSR program that maps a keyboard to a joystick, and then in Dosbox mapper, map the USB gamepad to a keyboard, so the scheme will be this:
USB gamepad button1 —using Dosbox mapper—> key "Z" —TSR program key to joy —> DOS joystick button1
So, when fire button is pressed on my USB gamepad, Dosbox receives it, but produces a "Z" key press instead, then the TSR program receives the "Z" press and send it as normal DOS Joystick button1, so Dynablaster receives what it expects.
There are a few DOS TSR programs to map a Joystick to a keyboard but not a keyboard to a joystick that will resolve this case and let 4 people play with 4 USB gamepads.
Bret, do you think this can be done? This will be very useful for all games like Dynablaster that doesn't support all players on the same keyboard and mix keyboard input and joystick input.