├── .gitignore
├── .python-version
├── .run
├── contextmanager_usage_example.run.xml
├── core_example.run.xml
├── example.run.xml
├── example_simple.run.xml
├── example_trigger .run.xml
├── example_trigger_deprecated.run.xml
├── shark.run.xml
├── tests.run.xml
├── tests_test_deadzone.run.xml
└── tests_test_update_level.run.xml
├── LICENSE
├── Makefile
├── README.md
├── README_PROTOCOL.md
├── poetry.lock
├── poetry.toml
├── pyproject.toml
├── requirements.txt
├── res
└── 70-dualsense.rules
├── research
├── ADAPTIVE_TRIGGER_EFFECTS.md
├── DSX_Resistance.csv
├── ExtendInput.DataTools.DualSense.TriggerEffectGenerator.cs
└── dualsense-controller.ods
├── src
├── dualsense_controller
│ ├── __init__.py
│ ├── api
│ │ ├── DualSenseController.py
│ │ ├── Properties.py
│ │ ├── __init__.py
│ │ ├── contextmanager.py
│ │ ├── enum.py
│ │ ├── property
│ │ │ ├── AccelerometerProperty.py
│ │ │ ├── BatteryProperty.py
│ │ │ ├── BenchmarkProperty.py
│ │ │ ├── ButtonProperty.py
│ │ │ ├── ConnectionProperty.py
│ │ │ ├── ExceptionProperty.py
│ │ │ ├── GyroscopeProperty.py
│ │ │ ├── JoyStickProperty.py
│ │ │ ├── LightbarProperty.py
│ │ │ ├── MicrophoneProperty.py
│ │ │ ├── OrientationProperty.py
│ │ │ ├── PlayerLedsProperty.py
│ │ │ ├── RumbleProperty.py
│ │ │ ├── TouchFingerProperty.py
│ │ │ ├── TriggerEffectProperty.py
│ │ │ ├── TriggerFeedbackProperty.py
│ │ │ ├── TriggerProperty.py
│ │ │ ├── __init__.py
│ │ │ └── base.py
│ │ └── typedef.py
│ └── core
│ │ ├── Benchmarker.py
│ │ ├── DualSenseControllerCore.py
│ │ ├── HidControllerDevice.py
│ │ ├── __init__.py
│ │ ├── core
│ │ ├── Lockable.py
│ │ └── __init__.py
│ │ ├── enum.py
│ │ ├── exception.py
│ │ ├── hidapi
│ │ ├── LICENSE.txt
│ │ ├── __init__.py
│ │ └── hidapi.py
│ │ ├── log.py
│ │ ├── report
│ │ ├── __init__.py
│ │ ├── in_report
│ │ │ ├── Bt01InReport.py
│ │ │ ├── Bt31InReport.py
│ │ │ ├── InReport.py
│ │ │ ├── Usb01InReport.py
│ │ │ ├── __init__.py
│ │ │ ├── enum.py
│ │ │ └── typedef.py
│ │ └── out_report
│ │ │ ├── Bt01OutReport.py
│ │ │ ├── Bt31OutReport.py
│ │ │ ├── OutReport.py
│ │ │ ├── Usb01OutReport.py
│ │ │ ├── __init__.py
│ │ │ ├── crc32.py
│ │ │ ├── enum.py
│ │ │ └── util.py
│ │ ├── state
│ │ ├── BaseStates.py
│ │ ├── State.py
│ │ ├── StateValueCallbackManager.py
│ │ ├── ValueCompare.py
│ │ ├── __init__.py
│ │ ├── enum.py
│ │ ├── mapping
│ │ │ ├── StateValueMapper.py
│ │ │ ├── __init__.py
│ │ │ ├── common.py
│ │ │ ├── enum.py
│ │ │ └── typedef.py
│ │ ├── read_state
│ │ │ ├── ReadState.py
│ │ │ ├── ReadStates.py
│ │ │ ├── ValueCalc.py
│ │ │ ├── ValueCompare.py
│ │ │ ├── __init__.py
│ │ │ ├── enum.py
│ │ │ └── value_type.py
│ │ ├── typedef.py
│ │ └── write_state
│ │ │ ├── WriteStates.py
│ │ │ ├── __init__.py
│ │ │ ├── enum.py
│ │ │ └── value_type.py
│ │ ├── typedef.py
│ │ └── util.py
└── examples
│ ├── __init__.py
│ ├── contextmanager_usage_example.py
│ ├── core_example.py
│ ├── example.py
│ ├── example_simple.py
│ ├── example_trigger.py
│ └── example_trigger_deprecated.py
├── teaser.jpg
├── tests
├── __init__.py
├── common.py
├── conftest.py
├── mock
│ ├── MockedHidapiMockedHidapiDevice.py
│ ├── __init__.py
│ └── common.py
├── test_creation.py
├── test_deadzone.py
├── test_mapping.py
└── test_update_level.py
└── tools_dev
├── __init__.py
└── shark
├── TSharkCapture.py
├── __init__.py
├── dsadasdas
├── shark.py
├── shark.sh
└── watch.sh
/.gitignore:
--------------------------------------------------------------------------------
1 | .venv
2 | .idea
3 | /dist
4 | __pycache__
5 | .~lock*
--------------------------------------------------------------------------------
/.python-version:
--------------------------------------------------------------------------------
1 | 3.10
2 |
--------------------------------------------------------------------------------
/.run/contextmanager_usage_example.run.xml:
--------------------------------------------------------------------------------
1 |
Byte Dec | 10 |Byte Hex | 11 |Name | 12 |Values | 13 |Description | 14 |
---|---|---|---|---|
0 | 17 |0x00 | 18 |Report ID | 19 |20 | | |
1 | 23 |0x01 | 24 |Feature flags (physical effects) | 25 |26 | | |
2 | 29 |0x02 | 30 |Feature flags (lights) | 31 |
32 | bit 0: MIC_MUTE_LED_CONTROL_ENABLE 33 | bit 1: POWER_SAVE_CONTROL_ENABLE 34 | bit 2: LIGHTBAR_CONTROL_ENABLE 35 | bit 3: RELEASE_LEDS 36 | bit 4: PLAYER_INDICATOR_CONTROL_ENABLE 37 | bit 5: UNKNOWN_FLAG_5 38 | bit 6: OVERALL_EFFECT_POWER 39 | bit 7: UNKNOWN_FLAG_7 40 | |
41 | 42 | Flag RELEASE_LEDS makes trouble and is currently disabled. All other known flags are enabled. 43 | | 44 |
3 | 47 |0x03 | 48 |Motor rumble right | 49 |0 - 255 | 50 |A.K.A. "small rumble" | 51 |
4 | 54 |0x04 | 55 |Motor rumble left | 56 |0 - 255 | 57 |A.K.A. "big rumble" | 58 |
5 | 61 |0x05 | 62 |63 | | 64 | | headphone, speaker, mic volume, audio flags (USB_Host_Shield_2.0) | 65 |
6 | 68 |0x06 | 69 |70 | | 71 | | headphone, speaker, mic volume, audio flags (USB_Host_Shield_2.0) | 72 |
7 | 75 |0x07 | 76 |77 | | 78 | | headphone, speaker, mic volume, audio flags (USB_Host_Shield_2.0) | 79 |
8 | 82 |0x08 | 83 |84 | | 85 | | |
9 | 88 |0x09 | 89 |Mute button led | 90 |
91 | 0x00 - Off 92 | 0x01 - On 93 | |
94 | |
10 | 97 |0x0A | 98 |Power save control | 99 |
100 | 0x00 - Unmute mic 101 | 0x10 - Mute mic 102 | |
103 | |
11 | 106 |0x0B | 107 |Right trigger - effect mode | 108 |
109 | 0x01 - CONTINUOUS_RESISTANCE 110 | 0x02 - SECTION_RESISTANCE 111 | 0x06 - VIBRATING 112 | 0x23 - EFFECT_EXTENDED 113 | 0xFC - CALIBRATE 114 | |
115 | |
12 | 118 |0x0C | 119 |Right trigger - Parameter 1 | 120 |121 | | Start of resistance section | 122 |
13 | 125 |0x0D | 126 |Right trigger - Parameter 2 | 127 |128 | | |
14 | 131 |0x0E | 132 |Right trigger - Parameter 3 | 133 |134 | | |
15 | 137 |0x0F | 138 |Right trigger - Parameter 4 | 139 |140 | | |
16 | 143 |0x10 | 144 |Right trigger - Parameter 5 | 145 |146 | | |
17 | 149 |0x11 | 150 |Right trigger - Parameter 6 | 151 |152 | | |
18 | 155 |0x12 | 156 |Right trigger - Parameter 7 | 157 |158 | | |
19 | 161 |0x13 | 162 |163 | | 164 | | |
20 | 167 |0x14 | 168 |169 | | 170 | | |
21 | 173 |0x15 | 174 |175 | | 176 | | |
22 | 179 |0x16 | 180 |Left trigger - effect mode | 181 |
182 | 0x01 - CONTINUOUS_RESISTANCE 183 | 0x02 - SECTION_RESISTANCE 184 | 0x06 - VIBRATING 185 | 0x23 - EFFECT_EXTENDED 186 | 0xFC - CALIBRATE 187 | |
188 | |
23 | 191 |0x17 | 192 |Left trigger - Parameter 1 | 193 |194 | | Start of resistance section | 195 |
24 | 198 |0x18 | 199 |Left trigger - Parameter 2 | 200 |201 | | |
25 | 204 |0x19 | 205 |Left trigger - Parameter 3 | 206 |207 | | |
26 | 210 |0x1A | 211 |Left trigger - Parameter 4 | 212 |213 | | |
27 | 216 |0x1B | 217 |Left trigger - Parameter 5 | 218 |219 | | |
28 | 222 |0x1C | 223 |Left trigger - Parameter 6 | 224 |225 | | |
29 | 228 |0x1D | 229 |Left trigger - Parameter 7 | 230 |231 | | |
30 | 234 |0x1E | 235 ||||
31 | 238 |0x1F | 239 ||||
32 | 242 |0x20 | 243 ||||
33 | 246 |0x21 | 247 ||||
34 | 250 |0x22 | 251 ||||
35 | 254 |0x23 | 255 ||||
36 | 258 |0x24 | 259 ||||
37 | 262 |0x25 | 263 |264 | | 265 | | Trigger motor effect strengths? (USB_Host_Shield_2.0) | 266 |
38 | 269 |0x26 | 270 |271 | | 272 | | Speaker volume? (USB_Host_Shield_2.0) | 273 |
39 | 276 |0x27 | 277 |278 | | 279 | | Led brightness, pulse? (USB_Host_Shield_2.0) | 280 |
40 | 283 |0x28 | 284 |285 | | 286 | | LIGHTBAR_SETUP_CONTROL_ENABLE? (dualsense (Javascript)) | 287 |
41 | 290 |0x29 | 291 |Lightbar control | 292 |
293 | 295 | 0b000 - LIGHTBAR_CONTROL_DISABLE? 296 | |
298 | 299 | |
42 | 302 |0x2A | 303 |Lightbar setup | 304 |
305 | 307 | 0x02 - LIGHT_OFF 308 | |
310 | 311 | |
43 | 314 |0x2B | 315 |Led brightness | 316 |
317 | 319 | 0x02 - MEDIUM 320 | 0x03 - LOW 321 | |
323 | Sets brightness of mute button and player leds. 324 | Only works when light-effects flag MIC_MUTE_LED_CONTROL_ENABLE is NOT set. This is done interally when 325 | setting brightness. 326 | |
327 |
44 | 330 |0x2C | 331 |Player leds | 332 |
333 | 335 | 0b00100 - CENTER 336 | 0b01010 - INNER 337 | 0b10001 - OUTER 338 | 0b11111 - ALL 339 | |
341 |
342 | CENTER: The single, center LED. 343 | INNER: The two LEDs adjacent to and directly surrounding the CENTER LED. 344 | OUTER: The two outermost LEDs surrounding the INNER LEDs. 345 | |
346 |
45 | 349 |0x2D | 350 |Lightbar led color red | 351 |352 | 0 - 255 353 | | 354 |355 | |
46 | 358 |0x2E | 359 |Lightbar led color green | 360 |361 | 0 - 255 362 | | 363 |364 | |
47 | 367 |0x2F | 368 |Lightbar led color blue | 369 |370 | 0 - 255 371 | | 372 |373 | |