From f7c13b8fcc4373f972387a0e7928658b818392b9 Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Fri, 18 Nov 2005 04:53:43 +0000 Subject: helplist: keys are not anymore secret, at least not for us professionals. skin fixed a bit. (discrete) standby added to help. --- lib/python/Tools/KeyBindings.py | 17 +++++++++++++++++ lib/python/Tools/__init__.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 lib/python/Tools/KeyBindings.py (limited to 'lib/python/Tools') 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"] -- cgit v1.2.3