TASEmulators / TASEmulators/BizHawk
Refactor `ControllerDefinition` to be more structured
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.8k
- Forks
- 468
- PR merge metrics
- No merged PRs in 30d
Description
Why are we squishing every button on every peripheral into a single list, then parsing the player index from them? Keep them separated from init. Same for console buttons.
The console buttons Power/Reset (and maybe the likes of Insert Coin and Toggle Difficulty) also need special-casing in terms of being surfaced in the main menubar under Emulator.
From https://github.com/TASEmulators/BizHawk/issues/4012#issuecomment-3298567288:
As groundwork for a one-click populate keybinds feature, I was thinking it might be good to group the virtual keyboard keys somehow inside the
ControllerDefinitionobject, which cores would set by using a newAddKeyboard(this ControllerDefinition def, string[][] rows)extension method similar toAddXYPair. (I'd choose a list of lists so that maybe it could also be used to eliminate or at least reduce the amount of boilerplate in virtual pad schemata for keyboards.) The keybinds dialog would then show a button if the metadata is present, and clicking the button would read from a newDefaultControlsprop (somehow; it's currently instantiated in theConfigctor and then falls out of scope without being stored).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating ControllerDefinition and tracing how peripheral and console buttons are collected, player indices are parsed, and menu items are surfaced. Review issue #4012's linked comment for the proposed keyboard metadata and DefaultControls lifetime. Done means these controls are structured separately from initialization and the related menu and keybind behavior is addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100