Skip to content

Commit

Permalink
Fix SCC OSD daemon crashing, fix USB DS4 (the rest is probably broken…
Browse files Browse the repository at this point in the history
… too?)
  • Loading branch information
C0rn3j committed Sep 17, 2024
1 parent b8c1cf3 commit 346f66b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions scc/drivers/ds4drv.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ def _load_hid_descriptor(self, config, max_size, vid, pid, test_mode):

self._packet_size = 64


def input(self, endpoint: bytearray, data: int) -> None:
# TODO: Which commit made data switch from bytes to bytearray?
def input(self, endpoint: int, data: bytearray) -> None:
# Special override for CPAD touch button
if _lib.decode(ctypes.byref(self._decoder), data):
if _lib.decode(ctypes.byref(self._decoder), bytes(data)):
if self.mapper:
if data[35] >> 7:
# cpad is not touched
Expand Down
2 changes: 1 addition & 1 deletion scc/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os
import time
import traceback
from collections import deque

from scc.actions import ButtonAction, GyroAbsAction
from scc.aliases import ALL_AXES, ALL_BUTTONS
Expand Down Expand Up @@ -395,6 +394,7 @@ def reset_gyros(self):


def input(self, controller, old_state, state):
# print(type(controller), type(old_state), type(state))
# Store states
self.old_state = old_state
self.old_buttons = self.buttons
Expand Down
19 changes: 10 additions & 9 deletions scc/x11/scc-osd-daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,24 @@
gi.require_version('Gtk', '3.0')
gi.require_version('Rsvg', '2.0')
gi.require_version('GdkX11', '3.0')
from gi.repository import Gdk, GdkX11, GLib, Gtk
from gi.repository import Gtk, Gdk, GdkX11, GLib

from scc.config import Config
from scc.gui.daemon_manager import DaemonManager
from scc.osd import OSDWindow
from scc.osd.area import Area
from scc.osd.dialog import Dialog
from scc.osd.gesture_display import GestureDisplay
from scc.osd.grid_menu import GridMenu
from scc.osd.radial_menu import RadialMenu
from scc.osd.hmenu import HorizontalMenu
from scc.osd.quick_menu import QuickMenu
from scc.osd.grid_menu import GridMenu
from scc.osd.keyboard import Keyboard
from scc.osd.menu import Menu
from scc.osd.message import Message
from scc.osd.quick_menu import QuickMenu
from scc.osd.radial_menu import RadialMenu
from scc.osd.dialog import Dialog
from scc.osd import OSDWindow
from scc.osd.menu import Menu
from scc.osd.area import Area
from scc.special_actions import OSDAction
from scc.tools import shsplit
from scc.config import Config


log = logging.getLogger("osd.daemon")

Expand Down

0 comments on commit 346f66b

Please sign in to comment.