Updates to dbus implementation.
This commit is contained in:
@@ -48,11 +48,15 @@ from . import cthulhu_platform # pylint: disable=no-name-in-module
|
|||||||
from . import script_manager
|
from . import script_manager
|
||||||
from . import cthulhu_state
|
from . import cthulhu_state
|
||||||
|
|
||||||
# Lazy import to avoid circular dependency
|
# Lazy imports to avoid circular dependency
|
||||||
def _get_input_event():
|
def _get_input_event():
|
||||||
from . import input_event
|
from . import input_event
|
||||||
return input_event
|
return input_event
|
||||||
|
|
||||||
|
def _get_input_event_manager():
|
||||||
|
from . import input_event_manager
|
||||||
|
return input_event_manager
|
||||||
|
|
||||||
class HandlerType(enum.Enum):
|
class HandlerType(enum.Enum):
|
||||||
"""Enumeration of handler types for D-Bus methods."""
|
"""Enumeration of handler types for D-Bus methods."""
|
||||||
|
|
||||||
@@ -670,7 +674,12 @@ class CthulhuRemoteController:
|
|||||||
def _wrapper(notify_user):
|
def _wrapper(notify_user):
|
||||||
event = _get_input_event().RemoteControllerEvent()
|
event = _get_input_event().RemoteControllerEvent()
|
||||||
script = cthulhu_state.activeScript
|
script = cthulhu_state.activeScript
|
||||||
return method(script=script, event=event, notify_user=notify_user)
|
if script is None:
|
||||||
|
manager = script_manager.getManager()
|
||||||
|
script = manager.getDefaultScript()
|
||||||
|
rv = method(script=script, event=event, notify_user=notify_user)
|
||||||
|
_get_input_event_manager().getManager().process_remote_controller_event(event)
|
||||||
|
return rv
|
||||||
return _wrapper
|
return _wrapper
|
||||||
handler_info = _HandlerInfo(
|
handler_info = _HandlerInfo(
|
||||||
python_function_name=attr_name,
|
python_function_name=attr_name,
|
||||||
@@ -692,7 +701,9 @@ class CthulhuRemoteController:
|
|||||||
if script is None:
|
if script is None:
|
||||||
manager = script_manager.getManager()
|
manager = script_manager.getManager()
|
||||||
script = manager.getDefaultScript()
|
script = manager.getDefaultScript()
|
||||||
return method(script=script, event=event, **kwargs)
|
rv = method(script=script, event=event, **kwargs)
|
||||||
|
_get_input_event_manager().getManager().process_remote_controller_event(event)
|
||||||
|
return rv
|
||||||
return _wrapper
|
return _wrapper
|
||||||
handler_info = _HandlerInfo(
|
handler_info = _HandlerInfo(
|
||||||
python_function_name=attr_name,
|
python_function_name=attr_name,
|
||||||
|
|||||||
@@ -256,6 +256,14 @@ class InputEventManager:
|
|||||||
mouse_event.setClickCount(self._determine_mouse_event_click_count(mouse_event))
|
mouse_event.setClickCount(self._determine_mouse_event_click_count(mouse_event))
|
||||||
self._last_input_event = mouse_event
|
self._last_input_event = mouse_event
|
||||||
|
|
||||||
|
def process_remote_controller_event(self, event: input_event.RemoteControllerEvent) -> None:
|
||||||
|
"""Processes this RemoteController event."""
|
||||||
|
|
||||||
|
# TODO - JD: It probably makes sense to process remote controller events here rather
|
||||||
|
# than just updating state.
|
||||||
|
self._last_input_event = event
|
||||||
|
self._last_non_modifier_key_event = None
|
||||||
|
|
||||||
def process_keyboard_event(self, _device, pressed, keycode, keysym, modifiers, text):
|
def process_keyboard_event(self, _device, pressed, keycode, keysym, modifiers, text):
|
||||||
"""Processes this Atspi keyboard event."""
|
"""Processes this Atspi keyboard event."""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user