git.cweiske.de
/
enigma2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1b472f9
)
use domain, provide removeKeyBindings for a domain
author
Felix Domke
<tmbinc@elitedvb.net>
Tue, 19 Jun 2007 23:33:23 +0000
(23:33 +0000)
committer
Felix Domke
<tmbinc@elitedvb.net>
Tue, 19 Jun 2007 23:33:23 +0000
(23:33 +0000)
lib/python/Tools/KeyBindings.py
patch
|
blob
|
history
diff --git
a/lib/python/Tools/KeyBindings.py
b/lib/python/Tools/KeyBindings.py
index 40c184f6ea6ec44ecda437db084edc824ad3d36a..5bd702547947ddc1aa37fe803a03dc2868ddf02e 100644
(file)
--- a/
lib/python/Tools/KeyBindings.py
+++ b/
lib/python/Tools/KeyBindings.py
@@
-27,18
+27,20
@@
keyDescriptions = {
KEYIDS["KEY_PREVIOUS"]: ("prev", 559, 203)
}
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:
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, [ ])
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])