Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Invert Gyro Roll for Steam Deck input handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryochan7 committed Jun 8, 2023
1 parent ae2757d commit 1737c41
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scc/drivers/steamdeck.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ def _on_input(self, endpoint, data):
self.configure()
self._ready = True

self._old_state, self._input = self._input, self._old_state
# Don't like this version
#self._old_state, self._input = self._input, self._old_state
ctypes.memmove(ctypes.addressof(self._input), data, len(data))
if self._input.seq % UNLIZARD_INTERVAL == 0:
# Keeps lizard mode from happening
Expand Down Expand Up @@ -221,10 +222,16 @@ def _on_input(self, endpoint, data):
self._input.stick_y = apply_deadzone(self._input.stick_y, STICK_DEADZONE)
self._input.rstick_x = apply_deadzone(self._input.rstick_x, STICK_DEADZONE)
self._input.rstick_y = apply_deadzone(self._input.rstick_y, STICK_DEADZONE)

# Invert Gyro Roll to match Steam Controller coordinate system
self._input.groll = self._input.groll

m = self.get_mapper()
if m:
self.mapper.input(self, self._old_state, self._input)

# Preserve current state into previous state object
self._old_state = self._input

def close(self):
if self._ready:
Expand Down

0 comments on commit 1737c41

Please sign in to comment.