Skip to content

Commit

Permalink
DILL initialization order changed to work with hidguardian
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiteMagic committed Jul 21, 2019
1 parent 0e4e142 commit 750d85e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dill/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ def device_exists(guid):
return DILL._dll.device_exists(guid.ctypes)

@staticmethod
def initialize():
def initialize_capi():
"""Initializes the functions as class methods."""
for fn_name, params in DILL.api_functions.items():
dll_fn = getattr(DILL._dll, fn_name)
Expand All @@ -657,4 +657,4 @@ def initialize():


# Initialize the class
DILL.initialize()
DILL.initialize_capi()
2 changes: 0 additions & 2 deletions gremlin/event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ def reload_calibrations(self):

def _run(self):
"""Starts the event loop."""
dill.DILL.init()
#time.sleep(1)
dill.DILL.set_device_change_callback(self._joystick_device_handler)
dill.DILL.set_input_event_callback(self._joystick_event_handler)
while self._running:
Expand Down
3 changes: 2 additions & 1 deletion joystick_gremlin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,8 @@ def exception_hook(exception_type, value, trace):
app.setApplicationDisplayName("Joystick Gremlin")

# Ensure joystick devices are correctly setup
time.sleep(1)
dill.DILL.init()
time.sleep(0.25)
gremlin.joystick_handling.joystick_devices_initialization()

# Check if vJoy is properly setup and if not display an error
Expand Down

0 comments on commit 750d85e

Please sign in to comment.