Repository navigation
Files and mapping format
Everything the add-on keeps on the console lives under /etc/options_menu/inputs/. The Options Menu and its add-ons run as root, so every file below is owned by root.
| Path | What it is | Who writes it | Mode |
|---|---|---|---|
inputs/profiles/<vendor>_<product>.map |
Ready-made mapping for a USB controller model | The add-on's .hmod, when it is installed |
0644 |
inputs/pads/<vendor>_<product>.map |
Your own mapping for that model. It wins over the profile | The remapper, when you press Save |
0644, in a 0755 folder |
inputs/sdl2/gamecontrollerdb.txt |
Your front-port mapping: a copy of the console's database with only the Nintendo Clovercon line changed |
The remapper, when you press Save |
0644, in a 0755 folder |
inputs/gamepad_remapper, inputs/pad_mapper
|
The remapper screen and the background service | The .hmod
|
0755 |
/etc/preinit.d/p8000_gamepadremapper |
Mounts your front-port database over /etc/sdl2/gamecontrollerdb.txt at every boot |
The remapper, when you press Save | 0644 |
/tmp/pad_mapper.pause |
Exists only while a button is being captured. It holds the remapper's process id, and pad_mapper ignores it if that process is gone |
The remapper | 0644 |
<vendor> and <product> are the controller's USB ID as four lowercase hex digits each, for example 0e6f_0180 for the Krom Kumite.
Restore defaults on a USB controller deletes its file in pads/, and the profile in profiles/ applies again. On the front ports it removes your database and the boot hook.
Uninstalling the add-on removes the whole inputs/ folder, including your own mappings in pads/. Copy them first if you want to keep them.
A mapping file is plain text, one button=source line per button.
a=k305
b=k306
dpup=h0y-
dpdown=h0y+
leftx=a0
The buttons are the ones the remapper lists: dpup, dpdown, dpleft, dpright, a, b, x, y, leftshoulder, rightshoulder, back (Select), start, lefttrigger (ZL), righttrigger (ZR), guide (Home), leftx, lefty, rightx and righty.
A source is where the press comes from on the USB controller:
| Source | Meaning |
|---|---|
k<code> |
A button, by its Linux input event code, for example k305
|
a<n> |
An analog axis, used as an axis. For the sticks |
a<n>+ / a<n>-
|
An analog axis, used as a button when pushed past half way in that direction |
h<n>x+ / h<n>x-, h<n>y+ / h<n>y-
|
A hat switch (the D-pad on most controllers), by hat number, axis and direction |
A button that is missing from the file is left unmapped. Lines are applied as soon as pad_mapper notices the file has changed, within about a second.
The front ports use the console's own SDL database instead of these files. The remapper only changes the Nintendo Clovercon line (GUID 180000004e696e74656e646f20436c00) and copies every other line as it is.