Configuring Gamepad and Keyboard Mappings in Browser-Based DOSBox-WASM

A guide to using the DOSBox-WASM internal keymapper (Ctrl + F1) to remap legacy arrow keys, set up WASD navigation, and configure modern controllers.

In the 1980s and early 1990s, the modern conventions of PC gaming controls—such as using W, A, S, D for movement and the mouse for looking around—had not yet become standardized. Early MS-DOS titles often expected players to navigate using the numeric keypad, arrow keys, or awkward combinations like Ctrl and Alt for actions and firing.

When playing classic titles like DOOM, Wolfenstein 3D, or Commander Keen inside browser-based DOSBox-WASM, navigating with these historical keybindings can feel unnatural.

Fortunately, DOSBox-WASM retains the complete internal graphical Keymapper interface from desktop DOSBox. This allows you to remap any emulated keyboard key to modern layouts or bind inputs to a connected USB or Bluetooth gamepad.

This guide explains how to access the internal keymapper and customize controls.


1. Key DOSBox-WASM Control Shortcuts

Before opening configuration menus, keep these core operational shortcuts in mind:

  • Ctrl + F1: Launches the graphical Keymapper overlay.
  • Ctrl + F10: Releases the captured mouse cursor (Pointer Lock) back to your operating system.
  • Alt + Enter: Toggles fullscreen display.
  • Ctrl + F11 / Ctrl + F12: Decreases or increases emulated CPU cycles (adjusts execution speed for timing-sensitive titles).

2. Using the Keymapper to Rebind Keys (Ctrl + F1)

The internal keymapper allows you to intercept physical keyboard presses and map them to different emulated DOS keys:

  1. Click inside the DOSBox-WASM canvas to ensure the tab has keyboard focus.
  2. Press Ctrl + F1 on your keyboard.
  3. An overlay grid displaying an emulated 101-key keyboard layout and joystick schematic will appear.

Remapping Arrow Keys to WASD:

  1. In the on-screen visual keyboard, click the Up Arrow key with your mouse.
  2. In the lower control pane, click Add.
  3. Press the physical W key on your keyboard.
  4. Repeat this step for the remaining directions:
    • Select Down Arrow → click Add → press S.
    • Select Left Arrow → click Add → press A.
    • Select Right Arrow → click Add → press D.
  5. Once your bindings are configured, click Save in the bottom-right corner, then click Exit.

Your physical WASD keys will now send arrow key scan codes to the emulated DOS operating system.


3. Mapping Modern Controllers to DOS Joysticks

Many DOS games include native support for 15-pin analogue gameport joysticks (such as the Gravis GamePad or classic two-button flightsticks):

  1. Connect your Xbox, PlayStation, or generic USB controller via Bluetooth or USB cable.
  2. Focus the browser tab and press any face button on your controller so the browser’s Gamepad API registers the device.
  3. Open the Keymapper with Ctrl + F1.
  4. In the joystick section of the interface (labeled jaxis and jbutton), select an emulated joystick axis or button.
  5. Click Add and tilt the corresponding analog thumbstick or press the desired physical button on your modern gamepad.
  6. Click Save and Exit.
  7. In the game’s main menu or configuration setup, select “Joystick” as your primary control device.

Summary

The internal DOSBox-WASM keymapper (Ctrl + F1) provides a flexible way to bridge historical MS-DOS input schemes with modern hardware. Remapping arrow keys to WASD or binding analog controller thumbsticks ensures classic PC titles remain comfortable and responsive on contemporary computers.


Share this guide
DV

About the Author: Devin Vance

Devin Vance writes technical guides and performance benchmarks at TabGamer, covering browser graphics, WebGL flags, low-spec laptop optimization, and retro WebAssembly emulation.