fix(input_manager): prevent gamepad input handling during game execution

Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
Boris Yumankulov 2025-06-05 19:33:08 +05:00
parent a3d7351e16
commit aabf8cb30f
Signed by: Boria138
GPG Key ID: 14B4A5673FD39C76

View File

@ -357,6 +357,8 @@ class InputManager(QObject):
@Slot(int) @Slot(int)
def handle_button_slot(self, button_code: int) -> None: def handle_button_slot(self, button_code: int) -> None:
try: try:
if getattr(self._parent, '_gameLaunched', False):
return
app = QApplication.instance() app = QApplication.instance()
if not app: if not app:
return return
@ -407,6 +409,8 @@ class InputManager(QObject):
@Slot(int, int, float) @Slot(int, int, float)
def handle_dpad_slot(self, code: int, value: int, current_time: float) -> None: def handle_dpad_slot(self, code: int, value: int, current_time: float) -> None:
try: try:
if getattr(self._parent, '_gameLaunched', False):
return
app = QApplication.instance() app = QApplication.instance()
if not app: if not app:
return return