> For the complete documentation index, see [llms.txt](https://wiki.retrobat.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.retrobat.org/controllers/gun_controls.md).

# Gun controls

Bang Bang !

This page lists the systems and emulators in which RetroBat configures lightguns, and how the gun buttons are mapped. To connect a gun, enable it and set the common options, see [Lightguns](https://wiki.retrobat.org/controllers/supported-controllers/lightguns.md).

## How RetroBat maps a gun

A lightgun works as a mouse (aiming and buttons), often with a keyboard for its extra buttons. In each emulator, RetroBat assigns them to the emulated gun with the same logic:

<table><thead><tr><th width="371.5">Gun button</th><th>Default mapping</th></tr></thead><tbody><tr><td>Trigger</td><td>Left click</td></tr><tr><td>Second button (reload, A, cursor…, depending on the gun)</td><td>Right click</td></tr><tr><td>Third button</td><td>Middle click</td></tr><tr><td>Start</td><td>Key 1 (P1), 2 (P2), 3 (P3), 4 (P4)</td></tr><tr><td>Coin / Select</td><td>Key 5 (P1), 6 (P2), 7 (P3), 8 (P4)</td></tr></tbody></table>

* **Reload**: in most games, you reload by shooting off the screen. If your gun cannot shoot off-screen, enable **RELOAD WITH BUTTON**.
* **INVERT TRIGGER/RELOAD** swaps the left and right clicks (e.g. Wii Zapper).
* **Wiimote with DolphinBar**: the buttons send other keys, RetroBat adapts the mapping (D-pad Right = Start, D-pad Left = Coin). See [Wiimote & DolphinBar](https://wiki.retrobat.org/controllers/supported-controllers/lightguns/wiimoteandbar.md).
* **RetroArch**: the buttons of your gamepad also stay assigned to the gun buttons (Start, Select, auxiliary buttons, D-pad), so you can use a gamepad along with the gun.

## Enabling the guns

For lightgun games, the guns are enabled automatically (see [Lightguns](https://wiki.retrobat.org/controllers/supported-controllers/lightguns.md)). Exceptions:

* **RPCS3**: choose the type of gun with **ENABLE GUN** (**RAW MOUSE** for GunCon 3, **PS EYE** for PlayStation Move games). It is never enabled automatically.
* **Hypseus** and **Singe 2**: the gun always works as a mouse, there is no option to enable.
* **Wii**: the Wiimotes are used as real Wiimotes, see the [Wii](https://wiki.retrobat.org/systems-and-emulators/supported-game-systems/game-consoles/nintendo-game-consoles/wii.md) page.
* **Keisho**, **lr-sm2** and **Odin**: without a gun, the shooting games stay playable, you aim with the mouse (and with a gamepad stick in Keisho and lr-sm2).
* **Mednafen**: the Mednafen **ENABLE GUN** option forces the gun on or off.
* **Mesen**: **GUN PORT** chooses the port (Zapper and Super Scope in port 2, Light Phaser in port 1 by default).

## Compatible systems and emulators

The **Guns** column gives the number of guns RetroBat can configure at the same time. The game must also support several players.

<table><thead><tr><th width="160.25">System</th><th width="160.25">Emulator</th><th width="161.75">Guns</th><th>Notes</th></tr></thead><tbody><tr><td>Arcade</td><td>lr-fbneo</td><td>Up to 4</td><td></td></tr><tr><td></td><td>lr-mame, lr-mame2003_plus, lr-mame2016</td><td>Up to 4</td><td></td></tr><tr><td></td><td>MAME (mame64, groovymame)</td><td>Up to 4</td><td></td></tr><tr><td>3DO</td><td>lr-opera</td><td>Up to 4</td><td>3DO light gun; cabinet light gun with the <code>3do_arcade_saot.bin</code> BIOS</td></tr><tr><td>ActionMax, Daphne, Singe</td><td>hypseus</td><td>Several</td><td>One mouse per gun (except with <strong>USE ONE GUN ONLY</strong>)</td></tr><tr><td></td><td>singe2</td><td>1</td><td></td></tr><tr><td>Amiga</td><td>amiberry</td><td>2</td><td>Light pen or Trojan Phazer (<strong>GUN TYPE</strong>)</td></tr><tr><td>Amstrad CPC, GX4000</td><td>lr-cap32</td><td>Up to 4</td><td>Phaser or Gunstick (<strong>LIGHTGUN MODE</strong>)</td></tr><tr><td>Atari 2600</td><td>lr-stella</td><td>Up to 4</td><td></td></tr><tr><td>Atomiswave, Naomi, Naomi 2</td><td>lr-flycast</td><td>Up to 4</td><td></td></tr><tr><td></td><td>flycast</td><td>2 (4 with DemulShooter)</td><td></td></tr><tr><td></td><td>demul</td><td>1 (2 with DemulShooter)</td><td></td></tr><tr><td>Commodore 64, 128, VIC-20</td><td>lr-vice (x64, x64sc, x128, xvic)</td><td>1</td><td>Port 1 only. No gun on Plus/4 and PET</td></tr><tr><td>Dreamcast</td><td>lr-flycast</td><td>Up to 4</td><td></td></tr><tr><td></td><td>flycast</td><td>2 (4 with DemulShooter)</td><td></td></tr><tr><td></td><td>demul</td><td>1 (2 with DemulShooter)</td><td></td></tr><tr><td>Hikaru</td><td>odin</td><td>2</td><td>Brave Firefighters. Without a gun, the mouse aims for player 1</td></tr><tr><td>Lindbergh</td><td>linuxloader</td><td>1 (4 with DemulShooter)</td><td></td></tr><tr><td></td><td>teknoparrot</td><td>Up to 4</td><td></td></tr><tr><td>Master System</td><td>lr-genesis_plus_gx, lr-genesis_plus_gx_wide</td><td>Up to 4</td><td></td></tr><tr><td></td><td>lr-gearsystem</td><td>Up to 4</td><td></td></tr><tr><td></td><td>mesen</td><td>1</td><td></td></tr><tr><td></td><td>bizhawk (SMSHawk)</td><td>1</td><td></td></tr><tr><td>Mega Drive / Genesis, Mega-CD</td><td>lr-genesis_plus_gx, lr-genesis_plus_gx_wide</td><td>1</td><td>Menacer or Justifier (<strong>GUN TYPE</strong>)</td></tr><tr><td>Model 2</td><td>m2emulator</td><td>2</td><td>DemulShooter starts automatically with 2 guns</td></tr><tr><td></td><td>keisho</td><td>2</td><td>Without a gun: crosshair, aim with the mouse or a stick</td></tr><tr><td></td><td>lr-sm2</td><td>2</td><td>Without a gun: aim with the mouse or a stick</td></tr><tr><td>Model 3</td><td>supermodel</td><td>2</td><td>2 guns need <strong>MULTIGUN (RAW INPUT)</strong> (enabled by default)</td></tr><tr><td></td><td>keisho</td><td>2</td><td>Without a gun: crosshair, aim with the mouse or a stick</td></tr><tr><td></td><td>model3-vulkan</td><td>2</td><td>Crosshair only without a real gun (<strong>SHOW CROSSHAIR</strong>, <strong>CROSSHAIR STYLE</strong>)</td></tr><tr><td></td><td>lr-supermodel</td><td>Up to 4</td><td></td></tr><tr><td>Namco System 246/256</td><td>pcsx2x6</td><td>2</td><td></td></tr><tr><td></td><td>play</td><td>1</td><td>Aiming with the mouse cursor</td></tr><tr><td></td><td>teknoparrot</td><td>Up to 4</td><td></td></tr><tr><td>Namco 357/369</td><td>teknoparrot</td><td>2</td><td>Razing Storm, Deadstorm Pirates SE, Dark Escape 4D, Sailor Zombie (DemulShooter compatible)</td></tr><tr><td>NES / Famicom</td><td>lr-fceumm, lr-mesen, lr-nestopia</td><td>1</td><td></td></tr><tr><td></td><td>mesen</td><td>1</td><td>Zapper in port 2 (<strong>GUN PORT</strong> to change it)</td></tr><tr><td></td><td>mednafen, jgenesis, bizhawk (NesHawk)</td><td>1</td><td></td></tr><tr><td>Philips CD-i</td><td>lr-zcdi</td><td>1</td><td>Peacekeeper, port 1</td></tr><tr><td>PlayStation</td><td>lr-mednafen_psx_hw, lr-pcsx_rearmed, lr-swanstation</td><td>Up to 4</td><td>GunCon or Justifier (<strong>GUN TYPE</strong>, lr-mednafen_psx_hw)</td></tr><tr><td></td><td>duckstation</td><td>2</td><td></td></tr><tr><td></td><td>mednafen</td><td>1</td><td></td></tr><tr><td>PlayStation 2</td><td>pcsx2</td><td>1</td><td></td></tr><tr><td>PlayStation 3</td><td>rpcs3</td><td>2 (GunCon 3), 1 (PS Move)</td><td></td></tr><tr><td>PSX Arcade</td><td>arcadeduck</td><td>Several</td><td></td></tr><tr><td>Saturn</td><td>lr-kronos, lr-mednafen_saturn, lr-ymir</td><td>Up to 4</td><td></td></tr><tr><td></td><td>kronos, mednafen, bizhawk (Saturnus)</td><td>1</td><td></td></tr><tr><td>Sega Chihiro</td><td>xemu-chihiro</td><td>2</td><td></td></tr><tr><td></td><td>cxbx, chihiro, chihiro-gun</td><td>1 (2 with DemulShooter)</td><td></td></tr><tr><td></td><td>teknoparrot</td><td>Up to 4</td><td></td></tr><tr><td>Super Nintendo</td><td>lr-snes9x</td><td>1 (2 with Justifiers)</td><td>Superscope, Justifier, M.A.C.S. Rifle or Justifiers (<strong>GUN TYPE</strong>)</td></tr><tr><td></td><td>lr-bsnes, lr-bsnes_hd_beta, lr-bsnes-jg, lr-mesen-s</td><td>1</td><td></td></tr><tr><td></td><td>snes9x</td><td>1 (2 with 2 Justifiers)</td><td>Super Scope by default, Justifier for the games that use it (<strong>GUN TYPE</strong>)</td></tr><tr><td></td><td>mesen</td><td>1</td><td>Super Scope in port 2 (<strong>GUN PORT</strong> to change it)</td></tr><tr><td></td><td>mednafen, jgenesis, bizhawk (BSNES, Snes9x)</td><td>1</td><td></td></tr><tr><td>TeknoParrot</td><td>teknoparrot</td><td>Up to 4</td><td></td></tr><tr><td>Wii</td><td>dolphin</td><td>1</td><td></td></tr><tr><td>Windows</td><td>Games compatible with DemulShooter</td><td>Up to 4</td><td>DemulShooter starts automatically with 2 guns or more</td></tr><tr><td>Xbox</td><td>cxbx</td><td>1</td><td></td></tr></tbody></table>

### DemulShooter

DemulShooter adds the support of several guns (and of outputs such as recoil) to games and emulators that cannot handle several guns on their own. It is provided with RetroBat in `system\tools\demulshooter`.

* **Model 2 (m2emulator)** and **Windows games**: DemulShooter starts automatically when 2 guns or more are connected. Set **USE DEMULSHOOTER** to **OFF** to disable it.
* **Flycast, Demul, TeknoParrot, Linuxloader, Chihiro (Cxbx)**: set **USE DEMULSHOOTER** to **ON** in the **GUNS** options of the system or game.

For outputs (recoil, lights) with MAME, Flycast, Demul, Model 2, Supermodel, TeknoParrot and Windows games, also see the **USE MAMEHOOKER** option. Odin and ArcadeDuck send their outputs with the **EXTERNAL OUTPUTS** option (**CONTROLS** menu). Keisho drives the recoil motor of the guns that have one itself (**ENABLE GUN RECOIL**, **RECOIL STRENGTH**).

## Button mapping per emulator

### RetroArch

<table><thead><tr><th width="352.75">Cores</th><th>Left click</th><th>Right click</th><th>Middle click</th></tr></thead><tbody><tr><td>lr-cap32, lr-fceumm, lr-kronos, lr-mednafen_saturn, lr-stella, lr-ymir</td><td>Trigger</td><td>Reload</td><td>Start</td></tr><tr><td>lr-opera</td><td>Trigger</td><td>Reload</td><td>Option (Select)</td></tr><tr><td>lr-bsnes, lr-bsnes_hd_beta, lr-gearsystem, lr-genesis_plus_gx, lr-genesis_plus_gx_expanded, lr-genesis_plus_gx_wide, lr-mednafen_psx_hw, lr-mesen, lr-pcsx_rearmed, lr-snes9x, lr-swanstation</td><td>Trigger</td><td>Aux A</td><td>Aux B</td></tr><tr><td>lr-fbneo, lr-flycast</td><td>Trigger</td><td>Aux A</td><td>Start</td></tr><tr><td>lr-nestopia</td><td>Trigger</td><td>Aux B</td><td>–</td></tr><tr><td>Other cores (lr-bsnes-jg, lr-mame, lr-mame2003_plus, lr-mame2016, lr-mesen-s, lr-sm2, lr-supermodel, lr-vice, lr-zcdi)</td><td>Trigger</td><td>Reload</td><td>Aux A</td></tr></tbody></table>

* Keyboard (player 1): Start = **1**, Select = **5**, D-pad = arrow keys. Player 2: **2** / **6**, etc.
* **RELOAD WITH BUTTON**: reload goes to the right click, and the button of the right click moves to the middle click.
* **GUN A/B BUTTONS MAPPING** > **KEYPAD LEFT/RIGHT**: Aux A and Aux B on the left and right arrow keys (D-pad of a Wiimote).
* **lr-sm2** (Model 2): with the guns enabled, only the gun moves the crosshair. Without a gun, you aim with the mouse or a stick (**STICK AIMING**). Options: **SHOW CROSSHAIR**, **HIDE INACTIVE CROSSHAIR**, **HIDE SHOT FLASH**.

### Other emulators

<table><thead><tr><th width="194">Emulator</th><th>Mapping</th></tr></thead><tbody><tr><td>MAME (mame64, groovymame)</td><td>Button 1: left click, Button 2: right click, Button 3: middle click. Start: 1 to 4, Coin: 5 to 8</td></tr><tr><td>flycast</td><td>Trigger: left click, Reload: right click, Start: middle click. Some Naomi/Atomiswave games use other buttons (<code>flycast_Arcade.yml</code> file, <strong>MOUSE MAPPING</strong> option)</td></tr><tr><td>demul</td><td>Emulator mapping</td></tr><tr><td>m2emulator</td><td>See m2emulator controller mapping</td></tr><tr><td>supermodel</td><td>Trigger: left click, Offscreen shot (reload): right click</td></tr><tr><td>model3-vulkan</td><td><p>Trigger: left click, Offscreen shot (reload): right click, Start: 1 / 2, Coin: 5 / 6.</p><p>Wiimote with DolphinBar: D-pad right = Start, D-pad left = Coin (player 1, if player 2 does not use a DolphinBar too)</p></td></tr><tr><td>keisho</td><td>Trigger: left click, Reload: right click, Start: 1 / 2, Coin: 5 / 6. Without a gun, the crosshair is shown in shooting games and you aim with the mouse or a controller stick</td></tr><tr><td>odin (Brave Firefighters)</td><td><p>Water (trigger): left click, Mist: right click, Start: middle click. Without a gun, the mouse aims for player 1.</p><p>Wiimote with DolphinBar: D-pad right = Start and D-pad left = Coin (1st Wiimote), D-pad up = Start and D-pad down = Coin (2nd Wiimote)</p></td></tr><tr><td>teknoparrot</td><td>Per game, in the <code>teknoparrot.yml</code> file (see below)</td></tr><tr><td>linuxloader</td><td>Trigger: left click, Reload: right click, Gun button: middle click, Action: key 1. To change with <strong>RELOAD MAPPING</strong>, <strong>GUN BUTTON MAPPING</strong> and <strong>ACTION BUTTON MAPPING</strong></td></tr><tr><td>xemu-chihiro</td><td>Trigger: left click, second button: right click, third button: middle click, reload by shooting off screen. Start: 1 / 2, Coin: 5 / 6</td></tr><tr><td>cxbx (Xbox, Chihiro)</td><td>Trigger: left click, Grip: right click, A: S, B: D, Start: 1, Back: 5</td></tr><tr><td>arcadeduck</td><td><p>Trigger: left click, Reload: right click, Start: 1 to 4, Coin: 5 to 8.</p><p>Wiimote with DolphinBar: D-pad right = Start and D-pad left = Coin (1st Wiimote), D-pad up = Start and D-pad down = Coin (2nd Wiimote)</p></td></tr><tr><td>pcsx2 (PS2)</td><td>Trigger: left click, Offscreen shot: right click, Recalibration: middle click, A: 1, B: 2, C: 3, Start: Enter, Select: Backspace. To change with <strong>GUNCON BUTTON MAPPING</strong> and <strong>CALIBRATION BUTTON</strong></td></tr><tr><td>pcsx2x6 (Namco 246/256)</td><td>Trigger: left click, A: right click, Start: 1 / 2, Coin: 5 / 6</td></tr><tr><td>play (Namco 246/256)</td><td>Trigger: left click, Pedal: right click, Start: 1, Coin: 5 (player 1). Per game, in the <code>&#x3C;game>_gun</code> blocks of the <code>play.yml</code> file</td></tr><tr><td>rpcs3</td><td>GunCon 3: Trigger: left click. PS Move (PS EYE): standard RPCS3 mouse mapping; the middle click is needed to pass the calibration screen (R1 can also be used)</td></tr><tr><td>duckstation</td><td>Trigger: left click, A: right click, B: middle click, Offscreen shot: 1 (P1) / 2 (P2). A/B to change with <strong>GUN A/B BUTTONS MAPPING</strong></td></tr><tr><td>mednafen</td><td>NES Zapper: Trigger: left click, Far shot: right click. PSX GunCon: Trigger: left click, A: right click, B: middle click, Offscreen shot: Space. PSX Justifier: Trigger: left click, O: right click, Start: middle click, Offscreen shot: Space. SNES Super Scope: Trigger: left click, Cursor: right click, Turbo: middle click, Offscreen shot: Space. Saturn: Trigger: left click, Offscreen shot: right click, Start: middle click</td></tr><tr><td>mesen</td><td>NES Zapper and SMS Light Phaser: Fire: left click, Offscreen shot: right click. SNES Super Scope: Fire: left click, Cursor: right click, Turbo: middle click</td></tr><tr><td>jgenesis</td><td>NES Zapper: Fire: left click, Offscreen shot: right click. SNES Super Scope: Fire: left click, Cursor: right click, Pause: middle click</td></tr><tr><td>bizhawk</td><td>NES Zapper and SMS Light Phaser: Trigger: left click. SNES Super Scope: Trigger: left click, Cursor: middle click, Turbo: right click. Saturn: Trigger: left click, Offscreen shot: right click, Start: middle click</td></tr><tr><td>snes9x</td><td>Emulator mapping for the Super Scope / Justifier</td></tr><tr><td>kronos</td><td>Trigger: left click, Start: right click</td></tr><tr><td>amiberry</td><td>Light pen button: left click</td></tr><tr><td>dolphin (Wii)</td><td>B: left click, A: right click, Shake: middle click, 1: key 1, 2: key 5, +: Enter, −: Backspace. Some games use another mapping, defined in <code>gamesdb.xml</code></td></tr></tbody></table>

### TeknoParrot mapping file

The gun mapping of each TeknoParrot game is defined in `system\resources\inputmapping\teknoparrot.yml`. To change it, copy the file to `user\inputmapping\teknoparrot.yml` and edit the copy: it is read first and is not overwritten by RetroBat updates.

In this file, the gun buttons are declared with `mouseleft`, `mousemiddle`, `mouseright`, `button4`, `button5`, and the keyboard keys with `kb_` followed by the key (e.g. `kb_5`).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://wiki.retrobat.org/controllers/gun_controls.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
