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.
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.