summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Holland <william.holland@codethink.co.uk>2015-06-03 13:53:43 +0100
committerWilliam Holland <william.holland@codethink.co.uk>2015-06-03 13:53:43 +0100
commit9d8a8e9fd7ccfeef152b0d20045e699d3342ba5f (patch)
treeb699a6b3b571cc27293987e1c34eee5c111428cd
parentd48ad9e046aac6720eb8fe601bb0a4ef503b1742 (diff)
downloadkeyboard-python-9d8a8e9fd7ccfeef152b0d20045e699d3342ba5f.tar.bz2
Add function to produce dict of KeyCombinations
This is so that an easily configured dict can be seen by somebody looking at the code.
-rw-r--r--keyboardpython/key.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/keyboardpython/key.py b/keyboardpython/key.py
index b820631..7ecca69 100644
--- a/keyboardpython/key.py
+++ b/keyboardpython/key.py
@@ -110,6 +110,13 @@ class Key:
ALT = Key('Alt')
CTRL = Key('Control')
+def _keyDict(in_dict):
+ to_return = {}
+ for pair in in_dict.items():
+ for code in pair[1]:
+ to_return[code] = KeyCombination(pair[0])
+ return to_return
+
_special_chars = {
' ': KeyCombination('Space'),
ESC : KeyCombination('Escape'),