aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Tools
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2007-06-19 23:33:23 +0000
committerFelix Domke <tmbinc@elitedvb.net>2007-06-19 23:33:23 +0000
commitdfbaaea681173a6f7d95e1574a851b1f462cf86e (patch)
treebc28df4d1ff16cd212c7ebc058c2c7e9f31ccf25 /lib/python/Tools
parent1b472f9ea444c2e6fc70d6c176a02bc2e25e9ec3 (diff)
downloadenigma2-dfbaaea681173a6f7d95e1574a851b1f462cf86e.tar.gz
enigma2-dfbaaea681173a6f7d95e1574a851b1f462cf86e.zip
use domain, provide removeKeyBindings for a domain
Diffstat (limited to 'lib/python/Tools')
-rw-r--r--lib/python/Tools/KeyBindings.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/python/Tools/KeyBindings.py b/lib/python/Tools/KeyBindings.py
index 40c184f6..5bd70254 100644
--- a/lib/python/Tools/KeyBindings.py
+++ b/lib/python/Tools/KeyBindings.py
@@ -27,18 +27,20 @@ keyDescriptions = {
KEYIDS["KEY_PREVIOUS"]: ("prev", 559, 203)
}
-def addKeyBinding(key, context, action):
- if (context, action) in keyBindings:
- keyBindings[(context, action)].append(key)
- else:
- keyBindings[(context, action)] = [key]
+def addKeyBinding(domain, key, context, action):
+ keyBindings.setdefault((context, action), []).append((key, domain))
def queryKeyBinding(context, action):
if (context, action) in keyBindings:
- return keyBindings[(context, action)]
+ return [x[0] for x in keyBindings[(context, action)]]
else:
return [ ]
def getKeyDescription(key):
if key in keyDescriptions:
return keyDescriptions.get(key, [ ])
+
+def removeKeyBindings(domain):
+ # remove all entries of domain 'domain'
+ for x in keyBindings:
+ keyBindings[x] = filter(lambda e: e[1] != domain, keyBindings[x])