Skip to content

Add Check Profile: catch device-numbering swaps and other silent profile problems - #38

Merged
Osiris-DevWorks merged 2 commits into
release/0.11.0from
claude/project-thread-sjzrlr
Nov 18, 2026
Merged

Osiris-DevWorks merged 2 commits into
release/0.11.0from
claude/project-thread-sjzrlr

Conversation

@Osiris-DevWorks

Copy link
Copy Markdown
Owner

Requested by Amr · project thread

What

Adds a Check Profile button to the header. It checks the loaded profile, unsaved edits included, and lists problems that the game never reports:

Check Severity
Profile js1/js2/… numbered differently from how this PC lists the sticks (bindings land on the wrong stick) Fix before playing
A profile stick isn't connected / a connected stick isn't in the profile Problem / note
View or look action forced to activationMode="press" (stuck camera, same bug as PR #32) Problem
One input bound to several different mode switches Problem
Deadzone/saturation tuning stored under a device ID no profile stick has Problem (when a sibling ID is present) / note
Hat with some directions bound (raised to Problem when view actions on that stick were cleared) Note / Problem
Bindings on buttons or hats the connected stick doesn't have Problem
Bindings on a jsN that has no device recorded Problem
js1 never cleared, so game-default joystick bindings still apply Note

The device table shows each profile slot next to what this PC has in that slot now. Check again re-reads the sticks after you re-plug one.

How the stick order is read

src/utils/system_devices.py:

  • Windows: DirectInput EnumDevices(GAMECTRL, ATTACHEDONLY) via ctypes on dinput8.dll. This is the order the game uses. No new dependency. Xbox-style XInput pads are skipped because the game treats them as a gamepad, not as jsN.
  • Elsewhere: pygame/SDL order. The dialog labels this as approximate.
  • --mock-joysticks: the virtual sticks in panel order, so you can test without hardware. tests/fixtures/mock_devices/check_profile_swapped.json combined with tests/fixtures/profiles/check_profile_problems.xml shows a swap.

Verified

  • pytest tests/: 90 passed. 20 of them are new in tests/test_profile_checker.py.
  • On Amr's live actionmaps.xml from today, before the repair, it flags all four problems from the repair: forced press on look-behind, the EVO R hat with view yaw cleared, js3_button27 switching salvage and mining, and EVO L tuning under 0205. On the repaired layout, those four are gone.
  • Every example profile checks without errors. It also finds the same salvage/mining clash on button 55 in layout_osiris-vkb-2025-10-25_exported.xml.
  • Offscreen GUI smoke test in mock mode: the dialog opens from a saved profile and from a modified one.

Needs a Windows test

The DirectInput path can't run in CI. On the game PC, open your profile and click Check Profile. The device table should show "Windows DirectInput" as its source, and all five slots should match. Then unplug one stick and press Check again.

Release

This is a feature, so it belongs in 0.11.0, not the 0.10.2 patch. It is based on main, like PR #37 was. Retarget it to release/0.11.0 once that branch opens. The CHANGELOG entry is under [Unreleased].


Generated by Claude Code

…le problems

Today's repair of Amr's live profile turned up four problems that neither
the game nor SCPE reported (a view action forced to "press", a hat with
its view directions cleared, one button firing two mode switches, and
stick tuning saved under an old device ID). Amr also asked for a check
that the profile's js1/js2/... numbering matches the order the PC lists
the sticks, since a mismatch silently moves bindings to the wrong stick.

profile_checker.py reads the raw XML (exported layout or live
actionmaps.xml) and returns findings; system_devices.py supplies the PC's
stick order from DirectInput on Windows (the game's source), pygame
elsewhere, or the virtual sticks in --mock-joysticks mode so it is
testable without hardware. The dialog shows profile-vs-PC slots side by
side and can re-check after re-plugging. Unsaved edits are checked via a
temp export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011hqxFh5GLh4UnV4rY8Fzdw
@Osiris-DevWorks Osiris-DevWorks self-assigned this Nov 18, 2026
@Osiris-DevWorks
Osiris-DevWorks changed the base branch from main to release/0.11.0 November 18, 2026 20:59
@Osiris-DevWorks Osiris-DevWorks mentioned this pull request Nov 18, 2026
6 tasks
@Osiris-DevWorks
Osiris-DevWorks merged commit 12ae686 into release/0.11.0 Nov 18, 2026
2 checks passed
@Osiris-DevWorks Osiris-DevWorks mentioned this pull request Nov 18, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants