Is there a “standard” or reasonably elegant way of navigating DirectGUI controls by keyboard and/or gamepad?
(If I’m not much mistaken, DirectGUI has none such built-in–but perhaps there’s a nice way of handling this case.)
I’ve just implemented support for this in a simple project, and, even with only a handful of controls, it feels messy and inelegant: there are at least two types of input to check for (unless I’ve missed a built-in way of generating key-like events from gamepad thumbstick movements); one can directly call “commandFunc” on GUI-objects, but some versions of that method take a parameter, while other’s done; I’m preventing the thumbstick from being too fast via a timer-variable; and it involves messing around with GUI-related stuff in otherwise gameplay-related code.
It feels like there might be a better way, and that seems worth asking after–especially before I attempt anything similar in a bigger project. :/
And I do feel that, in a game that supports playing entirely by gamepad or keyboard, it’s worth allowing the player to navigate the UI in the same way. (Playing by keyboard alone might be sufficiently unusual that it can be excluded, I suppose–but gamepad navigation seems like a good idea, I think.)