fix(input): overlapping modifiers not consistently respected #116
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug #115 complains that the player couldn't set the unequip modifier and the utility-activation modifier to the same thing and have them consistently respected. When I looked into this I was horrified to read what a mess I'd made of tracking key input.
It's still a mess after this PR, but it's less of a mess. And this fixes #115.
We demote the hotkey enum to a supporting role instead of a central one. The controller uses the keycode as the identifier for tracked keys, since it is in fact unique while hotkeys, as noted above, might not be. The modifier hotkey variants have been collapsed into a single variant with internal data representing what modifiers might be associated with that keypress (sadly via a new enum,
Modifier
). The controller passes the tracked key struct down through key event handlers when needed, instead of the hotkey variant. It also uses theAction
enum--which is definitely staying around--when that is meaningful.I didn't get to nuke some enum types from orbit yet, but I will soon.