help: improve key description, a bit.
[openblackhole/openblackhole-enigma2.git] / lib / python / Tools / KeyBindings.py
index b55e355..cc0a2d1 100644 (file)
@@ -1,6 +1,15 @@
 
 keyBindings = { }
 
+from keyids import KEYIDS
+
+keyDescriptions = {
+               KEYIDS["KEY_RED"]: "red",
+               KEYIDS["KEY_BLUE"]: "blue",
+               KEYIDS["KEY_MENU"]: "menu",
+               KEYIDS["KEY_VIDEO"]: "video"
+       }
+
 def addKeyBinding(key, context, action):
        if (context, action) in keyBindings:
                keyBindings[(context, action)].append(key)
@@ -14,4 +23,6 @@ def queryKeyBinding(context, action):
                return [ ]
 
 def getKeyDescription(key):
+       if key in keyDescriptions:
+               return keyDescriptions[key]
        return "key_%0x" % key