File: GAMEPAD_CUSTOM_MAPPING.md

package info (click to toggle)
vimix 0.9.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 90,688 kB
  • sloc: cpp: 98,036; ansic: 34,427; makefile: 373; objc: 97; xml: 95; sh: 49; python: 20
file content (98 lines) | stat: -rw-r--r-- 3,406 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Custom Gamepad Mapping File Guide

## Overview

Vimix allows you to specify a custom gamepad mapping database file to replace the embedded default database. This is useful when:

- You have controllers not in the default database
- You want to use an updated version of SDL_GameControllerDB
- You've created custom mappings for your specific hardware
- You need to maintain organization-specific controller configurations

## Quick Start

1. **Open vimix Settings**: Settings > Gamepad
2. **Download a mapping file**: Get the latest from [SDL_GameControllerDB](https://github.com/gabomdq/SDL_GameControllerDB)
3. **Specify the file**:
   - Type the path in the text field, or
   - Click "Browse" to select the file
4. **Automatic reload**: Mappings load immediately when you specify a file

## Vimix Settings for Gamepad Input

### Device Selector
- **Purpose**: Shows currently selected gamepad
- **Display**: Shows device name if recognized, "Not recognized" otherwise
- **Dropdown**: Lists all detected gamepads

### Custom Mapping File Input

**Text Field**:
- Enter path to your `gamecontrollerdb.txt` file
- Supports `~` for home directory (e.g., `~/gamecontrollerdb.txt`)
- Supports absolute paths (e.g., `/home/user/configs/gamecontrollerdb.txt`)
- Supports relative paths

**Browse Button** (📁 Browse):
- Opens file browser dialog
- Filters for `gamecontrollerdb.txt` and `*.txt` files
- Automatically applies selection

**Reload Button** (🔄 Reload):
- Manually reloads the mapping file
- Useful after editing the file externally
- Re-validates file existence

## File Format

The gamepad mapping file uses SDL's `gamecontrollerdb.txt` format:

```
# Comments start with #
# Format: GUID,Name,platform:Platform,a:button,b:button,x:button,...

# Linux Xbox Controller
030000005e040000120b000011010000,Xbox Series X Controller,platform:Linux,a:b0,b:b1,x:b2,y:b3,back:b6,start:b7,guide:b8,leftshoulder:b4,rightshoulder:b5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,

# Multiple platforms can be in the same file
030000005e040000120b000000000000,Xbox Series X Controller,platform:Windows,a:b0,b:b1,x:b2,y:b3,...
```

## Creating Custom Mappings

### Option 1: Download Latest Database

Get the community-maintained database:

```bash
wget https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt
mv gamecontrollerdb.txt ~/gamecontrollerdb.txt
```

Then in vimix Settings > Gamepad, enter: `~/gamecontrollerdb.txt`

### Option 2: Create Your Own Mapping

If your controller isn't in the database:

1. **Use SDL2 Gamepad Tool**:
   - Download from: https://generalarcade.com/gamepadtool/
   - Run the tool
   - Follow prompts to press buttons
   - Copy the generated mapping line

2. **Add to file**:
   ```bash
   # Create or edit your custom file
   echo "YOUR_MAPPING_LINE_HERE" >> ~/gamecontrollerdb.txt
   ```

3. **Load in vimix**: Settings > Gamepad > specify `~/gamecontrollerdb.txt`


### See Also

- [GAMEPAD_SUPPORT.md](GAMEPAD_SUPPORT.md) - General gamepad documentation
- [CONTRIBUTING_GAMEPAD_MAPPINGS.md](CONTRIBUTING_GAMEPAD_MAPPINGS.md) - How to create mappings
- [SDL_GameControllerDB](https://github.com/gabomdq/SDL_GameControllerDB) - Community database
- [SDL2 Gamepad Tool](https://generalarcade.com/gamepadtool/) - Mapping creation tool