diff options
author | William Holland <william.holland@codethink.co.uk> | 2015-06-03 13:53:43 +0100 |
---|---|---|
committer | William Holland <william.holland@codethink.co.uk> | 2015-06-03 13:53:43 +0100 |
commit | 9d8a8e9fd7ccfeef152b0d20045e699d3342ba5f (patch) | |
tree | b699a6b3b571cc27293987e1c34eee5c111428cd /keyboardpython | |
parent | d48ad9e046aac6720eb8fe601bb0a4ef503b1742 (diff) | |
download | keyboard-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.
Diffstat (limited to 'keyboardpython')
-rw-r--r-- | keyboardpython/key.py | 7 |
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'), |