aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Tools/KeyBindings.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/Tools/KeyBindings.py')
-rw-r--r--lib/python/Tools/KeyBindings.py17
1 files changed, 17 insertions, 0 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