Skip to content

Commit 346f66b

Browse files
committed
Fix SCC OSD daemon crashing, fix USB DS4 (the rest is probably broken too?)
1 parent b8c1cf3 commit 346f66b

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

scc/drivers/ds4drv.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ def _load_hid_descriptor(self, config, max_size, vid, pid, test_mode):
147147

148148
self._packet_size = 64
149149

150-
151-
def input(self, endpoint: bytearray, data: int) -> None:
150+
# TODO: Which commit made data switch from bytes to bytearray?
151+
def input(self, endpoint: int, data: bytearray) -> None:
152152
# Special override for CPAD touch button
153-
if _lib.decode(ctypes.byref(self._decoder), data):
153+
if _lib.decode(ctypes.byref(self._decoder), bytes(data)):
154154
if self.mapper:
155155
if data[35] >> 7:
156156
# cpad is not touched

scc/mapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import os
33
import time
44
import traceback
5-
from collections import deque
65

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

396395

397396
def input(self, controller, old_state, state):
397+
# print(type(controller), type(old_state), type(state))
398398
# Store states
399399
self.old_state = old_state
400400
self.old_buttons = self.buttons

scc/x11/scc-osd-daemon.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,24 @@
1717
gi.require_version('Gtk', '3.0')
1818
gi.require_version('Rsvg', '2.0')
1919
gi.require_version('GdkX11', '3.0')
20-
from gi.repository import Gdk, GdkX11, GLib, Gtk
20+
from gi.repository import Gtk, Gdk, GdkX11, GLib
2121

22-
from scc.config import Config
2322
from scc.gui.daemon_manager import DaemonManager
24-
from scc.osd import OSDWindow
25-
from scc.osd.area import Area
26-
from scc.osd.dialog import Dialog
2723
from scc.osd.gesture_display import GestureDisplay
28-
from scc.osd.grid_menu import GridMenu
24+
from scc.osd.radial_menu import RadialMenu
2925
from scc.osd.hmenu import HorizontalMenu
26+
from scc.osd.quick_menu import QuickMenu
27+
from scc.osd.grid_menu import GridMenu
3028
from scc.osd.keyboard import Keyboard
31-
from scc.osd.menu import Menu
3229
from scc.osd.message import Message
33-
from scc.osd.quick_menu import QuickMenu
34-
from scc.osd.radial_menu import RadialMenu
30+
from scc.osd.dialog import Dialog
31+
from scc.osd import OSDWindow
32+
from scc.osd.menu import Menu
33+
from scc.osd.area import Area
3534
from scc.special_actions import OSDAction
3635
from scc.tools import shsplit
36+
from scc.config import Config
37+
3738

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

0 commit comments

Comments
 (0)