pioneerspacesim/pioneer — pull request #1821 by robn (2012-12-16 05:06:47+00:00)
Title: New UI: Keyboard shortcuts

Reimplements the fairly useless keyboard shortcuts into something halfway sane.

After layout, the widget tree is walked and all the shortcuts are collected together. On key up, if no widget handles the event, the shortcuts are checked. If we find a match, a click event is synthesized and sent to the target widget.

If two widgets declare the same shortcut, only one of them will receive the event. Which one is arbitrary and unpredictable ("implementation-defined", in other words).

The Lua interface has a small string parser to create a KeySym, since its not really feasible to expose every key constant to Lua. Short strings like "shift+a" get converted to the appropriate KeySym.

#1667.