| Both sides previous revision Previous revision Next revision | Previous revision |
| remapping_controls_per_emulator [2021/12/26 09:14] – [Pad2key configuration file] consistency atari | remapping_controls_per_emulator [2024/10/31 16:04] (current) – Fix typo in a path lbrpdx |
|---|
| If you receive an error message saying something similar to "cannot save remap file", check for these folders: | If you receive an error message saying something similar to "cannot save remap file", check for these folders: |
| * ''/userdata/system/configs/retroarch/inputs/'' | * ''/userdata/system/configs/retroarch/inputs/'' |
| * ''/userdata/system/.config/retroarch/config/remaps/'' | * ''/userdata/system/configs/retroarch/config/remaps/'' |
| |
| If they don't exist, create them and try again. | If they don't exist, create them and try again. |
| You may have noticed the "Analog to Digital Type" setting. This setting is handled in //ES// as the Joystick-to-Dpad advanced system setting (or similarly named), however if you have a saved remap file then the setting in your remap file will take priority over ES's setting. | You may have noticed the "Analog to Digital Type" setting. This setting is handled in //ES// as the Joystick-to-Dpad advanced system setting (or similarly named), however if you have a saved remap file then the setting in your remap file will take priority over ES's setting. |
| |
| Remap files are saved to ''/userdata/system/.config/retroarch/remaps/(core name)/(core/folder/game name).rmp'' (you will need to enabled "Show hidden folders/files" in your file manager to view this directory). | Remap files are saved to ''/userdata/system/configs/retroarch/remaps/(core name)/(core/folder/game name).rmp'' (you will need to enabled "Show hidden folders/files" in your file manager to view this directory). |
| |
| === libretro: PUAE === | === libretro: PUAE/VICE === |
| |
| Controls for this emulator are stored in its core options, accessed via **Quick Menu** -> **Options** -> **RetroPad Mapping Options**. These take whatever you have assigned to the equivalent button in the **Controls** menu to another controller layer unique to this core. | Controls for these computer emulators are stored in its core options, accessed via **Quick Menu** -> **Options** -> **RetroPad Mapping Options**. These take whatever you have assigned to the equivalent button in the **Controls** menu to another controller layer unique to this core. |
| |
| {{:screenshot-2021.12.16-10h11.18.png?720|}} | {{:screenshot-2021.12.16-10h11.18.png?720|}} |
| {{:screenshot-2021.12.16-10h12.18.png?720|}} | {{:screenshot-2021.12.16-10h12.18.png?720|}} |
| |
| Then change your keymaps as appropriate. PUAE has decided to use the SNES layout for reference here, so A is {{:wiki:east.png?nolink&20|East button (A SNES)}}, B is {{:wiki:south.png?nolink&20|South button (B SNES)}}, X is {{:wiki:north.png?nolink&20|North button (X SNES)}} and Y is {{:wiki:west.png?nolink&20|West button (Y SNES)}}. | Then change your keymaps as appropriate. PUAE/VICE have decided to use the SNES layout for reference here, so A is {{:wiki:east.png?nolink&20|East button (A SNES)}}, B is {{:wiki:south.png?nolink&20|South button (B SNES)}}, X is {{:wiki:north.png?nolink&20|North button (X SNES)}} and Y is {{:wiki:west.png?nolink&20|West button (Y SNES)}}. |
| |
| {{:screenshot-2021.12.16-10h13.44.png?720|}} | {{:screenshot-2021.12.16-10h13.44.png?720|}} |
| |
| {{:screenshot-2021.12.16-10h16.40.png?720|}} | {{:screenshot-2021.12.16-10h16.40.png?720|}} |
| | |
| | ===== MAME ===== |
| | |
| | <WRAP center round todo> |
| | Massively improve this section. |
| | </WRAP> |
| | |
| | MAME machines can be remapped in-game: |
| | - Press ''[Enter]'' or push in ''[L3]'' + ''[R3]'' to open up the MAME menu. |
| | - Go to **Input for this game** and press ''[Enter]'' or {{:wiki:south.png?nolink&20|South button (B SNES)}}. |
| | - Select the desired input to remap and press ''[Enter]''/{{:wiki:south.png?nolink&20|South button (B SNES)}}, followed by the key/button desired to remap to. |
| | * Inputs can be cleared by double-tapping ''[Enter]''/{{:wiki:south.png?nolink&20|South button (B SNES)}} instead. |
| | |
| | Remap configuration files are stored at ''\userdata\saves\mame\mame(version)\cfg\'' |
| |
| ===== Pad2key ===== | ===== Pad2key ===== |
| |
| This functionality can help you create a per-game mapping of your controller to keyboard keys, in order to play games from old computers like Apple II, Sinclair or DOS and Windows games that are finicky with their joypad support. | This functionality can help you create a per-game mapping of your controller to keyboard keys, in order to play games from old computers like Apple II, Sinclair or DOS and Windows games that are finicky with their joypad support. |
| | |
| | It can also, to some extent, be used to define additional emulator command shortcuts from the controller (such as force-closing the emulator with ''[Alt]'' + ''[F4]'', not advisable if you like having non-corrupted save data). |
| |
| ==== Define a system-wide pad2key mapping ==== | ==== Define a system-wide pad2key mapping ==== |
| |
| The first thing to do is to select a game and press ''[SELECT]'', go to **ADVANCED SYSTEM CONFIGURATION** and select **Create pad to keyboard configuration**. | The first thing to do is to select a game in the game list and press ''[SELECT]'', go to **ADVANCED SYSTEM CONFIGURATION** and select **Create pad to keyboard configuration**. |
| |
| {{ :emulators:pad2key_option.png?480 |Screenshot of the options screen}} | {{ :emulators:pad2key_option.png?480 |Screenshot of the options screen}} |
| {{ :emulators:pad2key_configuration.png?540 |Screenshot of the pad2key configuration window listing the gamepad buttons}} | {{ :emulators:pad2key_configuration.png?540 |Screenshot of the pad2key configuration window listing the gamepad buttons}} |
| {{ :emulators:pad2key_keyboard.png?640 |Screenshot of the pad2key configuration window showing the keys that can be assigned to a button}} | {{ :emulators:pad2key_keyboard.png?640 |Screenshot of the pad2key configuration window showing the keys that can be assigned to a button}} |
| | |
| | <WRAP center round tip> |
| | To create a mapping to send a combination ("chord" or "combo") instead of a single key, use {{:wiki:north.png?nolink&20|North button (X SNES)}} to enter each of the initial keys in the combination, and use {{:wiki:south.png?nolink&20|South button (B SNES)}} to enter the final key. |
| | </WRAP> |
| | |
| |
| ==== Pad2key configuration file ==== | ==== Pad2key configuration file ==== |
| |
| Once your pad2key configuration is done for a specific game, it stays saved as a ''padto.keys'' or ''game_name.keys'' file next to your rom/in your Windows game directory folder. For a system-wide configuration, it'll be saved in ''/userdata/system/configs/evmapy/system-name.keys'', It is a plain JSON file with, for example: | Once your pad2key configuration is done for a specific game, it stays saved as a ''padto.keys'' or ''game_name.keys'' file next to your rom/in your Windows game directory folder. For a system-wide configuration, it'll be saved in ''/userdata/system/configs/evmapy/system-name.keys''. It is a plain JSON file with. Example: |
| |
| { | { |
| ] | ] |
| } | } |
| | |
| | === Action profiles === |
| |
| === Button names === | A singular keys file may contain the action profiles for multiple players. ''%%"actions_player1"%%'' will contain the actions for player 1, ''%%"actions_player2"%%'' for player 2 and so on. Each action profile contains its own unique set of triggers and targets. Example: |
| |
| The gamepad buttons are referred to specific values, they are as follow : | <code> |
| | { |
| | "actions_player1": [ |
| | { |
| | "trigger": [ |
| | "hotkey", |
| | "start" |
| | ], |
| | "type": "key", |
| | "target": [ |
| | "KEY_LEFTALT", |
| | "KEY_F4" |
| | ] |
| | }, |
| | { |
| | "trigger": "up", |
| | "type": "key", |
| | "target": "KEY_UP" |
| | } |
| | ], |
| | "actions_player2": [ |
| | { |
| | "trigger": [ |
| | "hotkey", |
| | "start" |
| | ], |
| | "type": "key", |
| | "target": [ |
| | "KEY_LEFTALT", |
| | "KEY_F4" |
| | ] |
| | }, |
| | { |
| | "trigger": "up", |
| | "type": "key", |
| | "target": "KEY_UP" |
| | } |
| | ] |
| | } |
| | </code> |
| | |
| | In Batocera **v37** and above, light guns can also contain their own actions. These are unique to the light guns, and thus use their own actions profile: ''%%"actions_gun1"%%''. Example: |
| | |
| | <code> |
| | { |
| | "actions_gun1": [ |
| | { |
| | "trigger": [ |
| | "3", |
| | "2" |
| | ], |
| | "type": "key", |
| | "target": [ |
| | "KEY_LEFTALT", |
| | "KEY_F4" |
| | ] |
| | } |
| | ] |
| | } |
| | </code> |
| | |
| | === Triggers === |
| | |
| | == Batocera Retropad names == |
| | |
| | The gamepad buttons are referred to specific values, they are as follows: |
| |
| * D-Pad UP : ''%%"trigger": "up"%%'' | * D-Pad UP : ''%%"trigger": "up"%%'' |
| * ''[HOTKEY]'' : ''%%"trigger": "hotkey"%%'' | * ''[HOTKEY]'' : ''%%"trigger": "hotkey"%%'' |
| |
| === Keyboard key names === | == Batocera light gun == |
| | |
| | Most Batocera light guns will automatically map themselves as a virtual keyboard and pointer device, associating their ID with a particular player controller. More info on each individual light gun mapping can be found on [[emulators:lightgun_games#button_mapping_wip|the light gun page]]. |
| | |
| | * Primary fire : ''%%"trigger": "left"%%'' |
| | * Secondary fire : ''%%"trigger": "right"%%'' |
| | * ''[START]'' : ''%%"trigger": "middle"%%'' |
| | * Aux button 1 : ''%%"trigger": "1"%%'' |
| | * Aux button 2 : ''%%"trigger": "2"%%'' |
| | * Aux button 3 : ''%%"trigger": "3"%%'' |
| | * Aux button 4 : ''%%"trigger": "4"%%'' |
| | * UP : ''%%"trigger": "5"%%'' |
| | * DOWN : ''%%"trigger": "6"%%'' |
| | * LEFT : ''%%"trigger": "7"%%'' |
| | * RIGHT : ''%%"trigger": "8"%%'' |
| | |
| | === Targets === |
| | |
| | == Keyboard key names == |
| |
| The targeted keyboard key uses the same names as the ones reported by triggerhappy events they can be displayed using the ''%%thd --listevents%%'' command. Here are some examples: | The targeted keyboard key uses the same names as the ones reported by triggerhappy events they can be displayed using the ''%%thd --listevents%%'' command. Here are some examples: |
| |
| * Alphabetical keys | * Alphabetical keys |
| * ''[A]'' : ''KEY_A'' | * ''[A]'' : ''%%"target": "KEY_A"%%'' |
| * ''[Z]'' : ''KEY_Z'' | * ''[Z]'' : ''%%"target": "KEY_Z"%%'' |
| * Number key (not the numpad) | * Number key (not the numpad) |
| * ''[1]'' : ''KEY_1'' | * ''[1]'' : ''%%"target": "KEY_1"%%'' |
| * ''[0]'' : ''KEY_0'' | * ''[0]'' : ''%%"target": "KEY_0"%%'' |
| * Numpad keys | * Numpad keys |
| * ''[0]'' : ''KEY_NUMERIC_0'' | * ''[0]'' : ''%%"target": "KEY_NUMERIC_0"%%'' |
| * ''[1]'' : ''KEY_NUMERIC_1'' | * ''[1]'' : ''%%"target": "KEY_NUMERIC_1"%%'' |
| * **%%*%%** : ''KEY_NUMERIC_STAR'' | * **%%*%%** : ''%%"target": "KEY_NUMERIC_STAR"%%'' |
| * Function keys | * Function keys |
| * ''[Esc]'' : ''KEY_FN_ESC'' | * ''[Esc]'' : ''%%"target": "KEY_FN_ESC"%%'' |
| * ''[F1]'' : ''KEY_FN_F1'' | * ''[F1]'' : ''%%"target": "KEY_FN_F1"%%'' |
| * ''[Enter]'' : ''KEY_ENTER'' | * ''[Enter]'' : ''%%"target": "KEY_ENTER"%%'' |
| |
| === External sources === | === External sources === |
| |
| Alternatively Pad2keys config files can be [[:scrape_from|scraped]] off screenscraper.fr, if you have enabled the option for it. | Alternatively Pad2keys config files can be [[:scrape_from|scraped]] off screenscraper.fr, if the option is enabled for it. |
| |
| You can find some examples from the [[:updates_and_downloads|Content Downloader]] for Windows games like Ri-Li or Super Mario War, both with embedded pad2key config files. | You can find some examples from the [[:updates_and_downloads|Content Downloader]] for Windows games like Ri-Li or Super Mario War, both with embedded pad2key config files. |
| === Launching commands with the pad2key === | === Launching commands with the pad2key === |
| |
| As you saw earlier, the pad2key can be used to simulate keyboard presses, however, it can also be used to launch specific commands, you need to replace the ''"type" : "key"'' to ''"type" : "exec"'', and set the ''"target"'' to the command. | As you saw earlier, the pad2key can be used to simulate keyboard presses, however, it can also be used to launch specific commands. Replace the ''"type" : "key"'' to ''"type" : "exec"'', and set the ''"target"'' to the command. |
| |
| For example: | For example: |
| <input name="joystick2left" value="C Button L" /> | <input name="joystick2left" value="C Button L" /> |
| <input name="joystick2right" value="C Button R" /> | <input name="joystick2right" value="C Button R" /> |
| | </inputList> |
| | |
| | </file> |
| | |
| | <file - input.xml - V38 and later> |
| | <inputList> |
| | <defaultInputList> |
| | <input name="AnalogDeadzone" value="0,0" /> |
| | <input name="AnalogPeak" value="32768,32768" /> |
| | <input name="l3" value="Mempak switch" /> |
| | <input name="r3" value="Rumblepak switch" /> |
| | <input name="a" value="C Button R" /> |
| | <input name="b" value="A Button" /> |
| | <input name="x" value="C Button U" /> |
| | <input name="y" value="B Button" /> |
| | <input name="start" value="Start" /> |
| | <input name="select" value="" /> |
| | <input name="pageup" value="L Trig" /> |
| | <input name="pagedown" value="R Trig" /> |
| | <input name="l2" value="Z Trig" /> |
| | <input name="r2" value="" /> |
| | <input name="up" value="DPad U" /> |
| | <input name="down" value="DPad D" /> |
| | <input name="right" value="DPad R" /> |
| | <input name="left" value="DPad L" /> |
| | <input name="joystick1up" value="Y Axis" /> |
| | <input name="joystick1down" value="Y Axis" /> |
| | <input name="joystick1left" value="X Axis" /> |
| | <input name="joystick1right" value="X Axis" /> |
| | <input name="joystick2up" value="C Button U" /> |
| | <input name="joystick2down" value="C Button D" /> |
| | <input name="joystick2left" value="C Button L" /> |
| | <input name="joystick2right" value="C Button R" /> |
| | </defaultInputList> |
| | <!-- Alt inputs for n64 style controllers --> |
| | <n64InputList> |
| | <input name="AnalogDeadzone" value="0,0" /> |
| | <input name="AnalogPeak" value="32768,32768" /> |
| | <input name="l3" value="Mempak switch" /> |
| | <input name="r3" value="Rumblepak switch" /> |
| | <input name="a" value="B Button" /> |
| | <input name="b" value="A Button" /> |
| | <input name="x" value="C Button U" /> |
| | <input name="y" value="C Button L" /> |
| | <input name="start" value="Start" /> |
| | <input name="select" value="Z Trig" /> |
| | <input name="pageup" value="L Trig" /> |
| | <input name="pagedown" value="R Trig" /> |
| | <input name="l2" value="C Button D" /> |
| | <input name="r2" value="C Button R" /> |
| | <input name="up" value="DPad U" /> |
| | <input name="down" value="DPad D" /> |
| | <input name="right" value="DPad R" /> |
| | <input name="left" value="DPad L" /> |
| | <input name="joystick1up" value="Y Axis" /> |
| | <input name="joystick1down" value="Y Axis" /> |
| | <input name="joystick1left" value="X Axis" /> |
| | <input name="joystick1right" value="X Axis" /> |
| | <input name="joystick2up" value="" /> |
| | <input name="joystick2down" value="" /> |
| | <input name="joystick2left" value="" /> |
| | <input name="joystick2right" value="" /> |
| | </n64InputList> |
| </inputList> | </inputList> |
| |
| </WRAP> | </WRAP> |
| |
| Firstly, if you'd like Batocera to handle emulated Wiimotes/Wii Classic Controller input, enable ''wii.emulatedwiimotes'' as described [[systems:wii#configuring_gamepad|on this page]]. This works best for games that support control via the Wii Classic Controller or the GameCube Controller. This can also be saved on a per-game basis by utilizing configuration files. | Firstly, if you'd like Batocera to handle emulated Wiimotes/Wii Classic Controller input, enable ''wii.emulatedwiimotes'' as described [[systems:wii#configuring_another_controller_to_simulate_a_wiimote_wii_classic_controller_gamecube_controller|on this page]]. This works best for games that support control via the Wii Classic Controller or the GameCube Controller. This can also be saved on a per-game basis by utilizing configuration files. |
| |
| If you prefer to use Dolphin's interface for configuring controls instead of Batocera's preset configurations, read on. | If you prefer to use Dolphin's interface for configuring controls instead of Batocera's preset configurations, read on. |
| |
| If you'd like to reconfigure the default keyboard bindings for all systems emulated by a libretro core (such as if you don't have a controller to use or you're in an all-in-one device like a netbook), refer to [[:advanced_retroarch_settings#reconfiguring_the_keyboard_for_retroarch|the keyboard controls section of the advanced RetroArch settings page]] instead. | If you'd like to reconfigure the default keyboard bindings for all systems emulated by a libretro core (such as if you don't have a controller to use or you're in an all-in-one device like a netbook), refer to [[:advanced_retroarch_settings#reconfiguring_the_keyboard_for_retroarch|the keyboard controls section of the advanced RetroArch settings page]] instead. |
| | |
| | ===== Default light gun mappings ===== |
| | |
| | Here are the default light gun mappings, in case you're configuring an emulator which does not support "press the button to map" remapping functionality: |
| | |
| | ^ Global keyboard/mouse code ^ Wiigun button ^ Wiigun code ^ Sinden button ^ Sinden code ^ GUN4IR button ^ GUN4IR code ^ AimTrack button ^ AimTrack code ^ AElightgun button ^ AElightgun code ^ Dolphinbar button ^ Dolphinbar code ^ GunCon2 button ^ GunCon2 code ^ |
| | | BTN_LEFT | B | BTN_EAST | Trigger | BTN_LEFT | Trigger | BTN_LEFT | Trigger | BTN_LEFT | Trigger | BTN_LEFT | B | BTN_LEFT | Trigger | BTN_LEFT | |
| | | BTN_RIGHT | A | BTN_SOUTH | Pump/Front left | BTN_RIGHT | Offscreen/A/C | BTN_RIGHT | Right side | BTN_RIGHT | Left mouse | BTN_RIGHT | A | BTN_RIGHT | C | BTN_RIGHT | |
| | | BTN_MIDDLE | PLUS | KEY_NEXT | Back left | BTN_MIDDLE | B | BTN_MIDDLE | Left side | BTN_MIDDLE | Middle mouse | BTN_MIDDLE | – | – | START | BTN_MIDDLE | |
| | | BTN_1 | MINUS | KEY_PREVIOUS | Front right | KEY_1 | START | KEY_1 | – | – | 1 | BTN_1 | – | – | SELECT | BTN_1 | |
| | | BTN_2 | 1 | BTN_1 | Back right | KEY_2 | SELECT | KEY_5 | – | – | 2 | BTN_2 | – | – | A | BTN_2 | |
| | | BTN_3 | 2 | BTN_2 | – | – | – | – | – | – | 3 | BTN_3 | – | – | B | BTN_3 | |
| | | BTN_4 | HOME | BTN_MODE | – | – | – | – | – | – | 4 | BTN_4 | – | – | – | – | |
| | | BTN_5 | ↑ | KEY_UP | ↑ | KEY_UP | ↑ | KEY_UP | – | – | Up | KEY_UP | – | – | ↑ | 5 | |
| | | BTN_6 | ↓ | KEY_DOWN | ↓ | KEY_DOWN | ↓ | KEY_DOWN | – | – | Down | KEY_DOWN | – | – | ↓ | 6 | |
| | | BTN_7 | ← | KEY_LEFT | ← | KEY_LEFT | ← | KEY_LEFT | – | – | – | – | – | – | ← | 7 | |
| | | BTN_8 | → | KEY_RIGHT | → | KEY_RIGHT | → | KEY_RIGHT | – | – | – | – | – | – | → | 8 | |
| |