Laxkit
0.0.7.1
|
Classes | |
class | ShortCutDef |
Holds info about a keyboard shortcut. More... |
When windows get key events, search a list of key mappings to get an associated action.
A window would define a list of actions, and store a list of shortcuts pointing to those actions. In the window's CharInput() function, the action number is found from its (redefinable) shortcuts and something like thewindow->action(shortcut->action) is called.
Shortcuts may be processed by ShortcutHandler and ShortcutManager objects.
The trick here is to have this accessible enough, that you can dump out a list of key commands at runtime. In the interest of saving space, maybe windows could just have pointer to a list, or ActionList() to return a list of available actions, that might have any key set to them, as well as ShortcutList() for actual bindings.
perhaps key chaining can be done with a little popup up in the corner of the affected window? that would greatly relieve the particular window from having a special key chain mode.. it would just respond to a shortcut-command message..
there could be a global ShortcutManager hash, where key is something like "ImageInterface" or "ViewwerWindow", and the value is a ShortcutHandler object. That way, shortcuts are synchronized across all interfaces of the same type