-
Committer:
Maciej Kisielewski
-
Date:
2016-07-11 12:39:35 UTC
-
Revision ID:
maciej.kisielewski@canonical.com-20160711123935-v2f90k00m4gewlnl
checkbox-touch:components: add KeysDelegator component
This patch adds a helper that aids capturing of keystrokes.
Example usage:
KeysDelegator {
id: keysDelegator
}
Keys.onPressed: keysDelegator.keyPress(event)
(...)
kd.setHandler('ctrl+q', Qt.quit)
Once handlers are assigned, it's easy to 'unset' them all at once (e.g. when
application changes the state and is supposed to watch for a different set of
keystrokes), or to change them.
Signed-off-by: Maciej Kisielewski <maciej.kisielewski@canonical.com>