Compare commits
5 Commits
main
...
b1e94b16b0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1e94b16b0
|
||
|
|
a74c43b972
|
||
|
|
15938ba376
|
||
|
|
128c4fde19 | ||
|
dde43f69d1
|
@@ -94,7 +94,7 @@ jobs:
|
|||||||
name: Build Arch Package
|
name: Build Arch Package
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
image: archlinux:base-devel@sha256:87a967f07ba6319fc35c8c4e6ce6acdb4343b57aa817398a5d2db57bd8edc731
|
image: archlinux:base-devel@sha256:943bdad9e9d0d23503f24797b44ce2cc1531bf101e18b3e7fb8c8776190dc45e
|
||||||
volumes:
|
volumes:
|
||||||
- /usr:/usr-host
|
- /usr:/usr-host
|
||||||
- /opt:/opt-host
|
- /opt:/opt-host
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ jobs:
|
|||||||
uses: https://gitea.com/actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
uses: https://gitea.com/actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: https://gitea.com/actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
uses: https://gitea.com/actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
|
||||||
with:
|
with:
|
||||||
python-version-file: "pyproject.toml"
|
python-version-file: "pyproject.toml"
|
||||||
|
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ jobs:
|
|||||||
needs: changes
|
needs: changes
|
||||||
if: needs.changes.outputs.arch == 'true' || github.event_name == 'workflow_dispatch'
|
if: needs.changes.outputs.arch == 'true' || github.event_name == 'workflow_dispatch'
|
||||||
container:
|
container:
|
||||||
image: archlinux:base-devel@sha256:87a967f07ba6319fc35c8c4e6ce6acdb4343b57aa817398a5d2db57bd8edc731
|
image: archlinux:base-devel@sha256:943bdad9e9d0d23503f24797b44ce2cc1531bf101e18b3e7fb8c8776190dc45e
|
||||||
volumes:
|
volumes:
|
||||||
- /usr:/usr-host
|
- /usr:/usr-host
|
||||||
- /opt:/opt-host
|
- /opt:/opt-host
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
- uses: https://gitea.com/actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
- uses: https://gitea.com/actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: https://gitea.com/actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
|
uses: https://gitea.com/actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ jobs:
|
|||||||
uses: https://gitea.com/actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
uses: https://gitea.com/actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: https://gitea.com/actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
uses: https://gitea.com/actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
|
||||||
with:
|
with:
|
||||||
python-version-file: "pyproject.toml"
|
python-version-file: "pyproject.toml"
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ jobs:
|
|||||||
- uses: https://gitea.com/actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
- uses: https://gitea.com/actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: https://gitea.com/actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
|
uses: https://gitea.com/actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
|
|||||||
@@ -131,6 +131,9 @@ class InputManager(QObject):
|
|||||||
self.last_update = time.time()
|
self.last_update = time.time()
|
||||||
self.update_interval = 0.016 # ~60 FPS
|
self.update_interval = 0.016 # ~60 FPS
|
||||||
self.emulation_active = False # Flag for external focus (updated in main thread)
|
self.emulation_active = False # Flag for external focus (updated in main thread)
|
||||||
|
self.emulation_triggered = False
|
||||||
|
self.back_held = False
|
||||||
|
self.guide_held = False
|
||||||
|
|
||||||
# Focus check timer for emulation flag (runs in main thread)
|
# Focus check timer for emulation flag (runs in main thread)
|
||||||
self.focus_check_timer = QTimer(self)
|
self.focus_check_timer = QTimer(self)
|
||||||
@@ -182,6 +185,8 @@ class InputManager(QObject):
|
|||||||
"""Update emulation_active flag based on Qt app focus (main thread only)."""
|
"""Update emulation_active flag based on Qt app focus (main thread only)."""
|
||||||
active = QApplication.activeWindow()
|
active = QApplication.activeWindow()
|
||||||
self.emulation_active = (active is None) # True for external windows (e.g., winefile)
|
self.emulation_active = (active is None) # True for external windows (e.g., winefile)
|
||||||
|
if not self.emulation_active:
|
||||||
|
self.emulation_triggered = False
|
||||||
|
|
||||||
def _navigate_game_cards(self, container, tab_index: int, code: int, value: int) -> None:
|
def _navigate_game_cards(self, container, tab_index: int, code: int, value: int) -> None:
|
||||||
"""Common navigation logic for game cards in a container."""
|
"""Common navigation logic for game cards in a container."""
|
||||||
@@ -1853,6 +1858,17 @@ class InputManager(QObject):
|
|||||||
|
|
||||||
# UI signal handling (always, for internal app)
|
# UI signal handling (always, for internal app)
|
||||||
if event.type == ecodes.EV_KEY:
|
if event.type == ecodes.EV_KEY:
|
||||||
|
if event.code == ecodes.BTN_EAST: # Back button
|
||||||
|
self.back_held = (event.value == 1)
|
||||||
|
|
||||||
|
if event.code in BUTTONS['guide']:
|
||||||
|
self.guide_held = (event.value == 1)
|
||||||
|
|
||||||
|
if event.value == 1:
|
||||||
|
if ((event.code in BUTTONS['guide'] and self.back_held) or
|
||||||
|
(event.code == ecodes.BTN_EAST and self.guide_held)):
|
||||||
|
self.emulation_triggered = not self.emulation_triggered
|
||||||
|
|
||||||
self.button_event.emit(event.code, event.value)
|
self.button_event.emit(event.code, event.value)
|
||||||
# Special handling for menu on press only
|
# Special handling for menu on press only
|
||||||
if event.value == 1 and event.code in BUTTONS['menu'] and not self._is_gamescope_session:
|
if event.value == 1 and event.code in BUTTONS['menu'] and not self._is_gamescope_session:
|
||||||
@@ -1881,8 +1897,8 @@ class InputManager(QObject):
|
|||||||
else:
|
else:
|
||||||
self.dpad_moved.emit(event.code, event.value, current_time)
|
self.dpad_moved.emit(event.code, event.value, current_time)
|
||||||
|
|
||||||
# Mouse emulation (only for external windows)
|
# Mouse emulation (only for external windows + triggered)
|
||||||
if self.mouse_emulation_enabled and self.emulation_active:
|
if self.mouse_emulation_enabled and self.emulation_active and self.emulation_triggered:
|
||||||
if event.type == ecodes.EV_ABS:
|
if event.type == ecodes.EV_ABS:
|
||||||
if event.code == ecodes.ABS_HAT0X:
|
if event.code == ecodes.ABS_HAT0X:
|
||||||
if event.value == -1:
|
if event.value == -1:
|
||||||
@@ -1920,6 +1936,9 @@ class InputManager(QObject):
|
|||||||
self.stick_x_raw = 0
|
self.stick_x_raw = 0
|
||||||
self.stick_y_raw = 0
|
self.stick_y_raw = 0
|
||||||
self.scroll_accumulator = 0.0
|
self.scroll_accumulator = 0.0
|
||||||
|
self.back_held = False
|
||||||
|
self.guide_held = False
|
||||||
|
self.emulation_triggered = False
|
||||||
break
|
break
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
logger.error(f"Unexpected error in gamepad monitoring: {ex}")
|
logger.error(f"Unexpected error in gamepad monitoring: {ex}")
|
||||||
@@ -1938,6 +1957,9 @@ class InputManager(QObject):
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
self.gamepad = None
|
self.gamepad = None
|
||||||
|
self.back_held = False
|
||||||
|
self.guide_held = False
|
||||||
|
self.emulation_triggered = False
|
||||||
|
|
||||||
def cleanup(self) -> None:
|
def cleanup(self) -> None:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ dependencies = [
|
|||||||
"icoextract>=0.2.0",
|
"icoextract>=0.2.0",
|
||||||
"numpy>=2.2.4",
|
"numpy>=2.2.4",
|
||||||
"orjson>=3.11.3",
|
"orjson>=3.11.3",
|
||||||
"pillow>=11.3.0",
|
"pillow>=12.0.0",
|
||||||
"psutil>=7.1.0",
|
"psutil>=7.1.0",
|
||||||
"pyside6==6.9.1",
|
"pyside6==6.9.1",
|
||||||
"pyudev>=0.24.3",
|
"pyudev>=0.24.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user