diff options
Diffstat (limited to 'lib/python/Tools')
| -rw-r--r-- | lib/python/Tools/KeyBindings.py | 17 | ||||
| -rw-r--r-- | lib/python/Tools/__init__.py | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/python/Tools/KeyBindings.py b/lib/python/Tools/KeyBindings.py new file mode 100644 index 00000000..b55e3555 --- /dev/null +++ b/lib/python/Tools/KeyBindings.py @@ -0,0 +1,17 @@ + +keyBindings = { } + +def addKeyBinding(key, context, action): + if (context, action) in keyBindings: + keyBindings[(context, action)].append(key) + else: + keyBindings[(context, action)] = [key] + +def queryKeyBinding(context, action): + if (context, action) in keyBindings: + return keyBindings[(context, action)] + else: + return [ ] + +def getKeyDescription(key): + return "key_%0x" % key diff --git a/lib/python/Tools/__init__.py b/lib/python/Tools/__init__.py index 72a1abb7..d8e646d0 100644 --- a/lib/python/Tools/__init__.py +++ b/lib/python/Tools/__init__.py @@ -1 +1 @@ -all = ["FuzzyDate.py", "XMLTools.py", "Directories.py"] +all = ["FuzzyDate.py", "XMLTools.py", "Directories.py", "KeyBindings.py"] |
