Ticket #698 (new enhancement)
GUI - Better support for keyboard input
| Reported by: | historic_bruno | Owned by: | |
|---|---|---|---|
| Priority: | Nice to Have | Milestone: | Backlog |
| Component: | Core engine | Keywords: | gui input keyboard |
| Cc: |
Description (last modified by historic_bruno) (diff)
It would be nice if the engine GUI would handle more standard keyboard input:
- Pressing enter when a button has focus should cause an onPress event
- Tab switching of focus between controls - the ordering could be the same as in the page XML, left to right for children of a given parent object, and/or support a "taborder" property to override the defaults. Obviously not every control should be included in the tabbing, restricting to input controls seems reasonable.
- Support keyboard accelerators, which are usually specified with an ampersand (&) character in the caption of an input control (the corresponding accelerator is often underlined). This way a dialog that asks "&Yes"/"&No" could be answered with the Y or N keys.
- Keys could be useful for navigating text lists and dropdowns. Imagine a map list with hundreds of items and you want to skip to "Punjab 1", it should be possible by tapping P to jump to maps named starting with 'p'. That's the simple case; a more complicated extension would be typing multiple characters to match partial words, but that gets messy and is never fully intuitive.
Change History
Note: See
TracTickets for help on using
tickets.

Might be fixed by implementing ManuallyHandleEvent?() for IGUIButtonBehavior, and handling an SDL_KEYDOWN event there for key value SDLK_RETURN. By handling the event in that abstract class we can gain the same behavior in related controls like checkboxes. See IGUIButtonBehavior::HandleMessage?() for how mouse press is handled.