Skip to content

Commit

Permalink
fix(input): overlapping modifiers not consistently respected (#116)
Browse files Browse the repository at this point in the history
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 the
`Action` 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.
  • Loading branch information
ceejbot authored Jan 19, 2024
1 parent 42db629 commit 073915c
Show file tree
Hide file tree
Showing 4 changed files with 281 additions and 198 deletions.
Loading

0 comments on commit 073915c

Please sign in to comment.