show timer duration in timer edit list
[enigma2.git] / lib / python / Tools / KeyBindings.py
1
2 keyBindings = { }
3
4 from keyids import KEYIDS
5
6 keyDescriptions = {
7                 KEYIDS["BTN_0"]: ("fp_up", 630, 320),
8                 KEYIDS["BTN_1"]: ("fp_down", 565, 320),
9                 KEYIDS["KEY_UP"]: ("up", 630, 320),
10                 KEYIDS["KEY_DOWN"]: ("down", 565, 320),
11                 KEYIDS["KEY_POWER"]: ("power", 615, 80),
12                 KEYIDS["KEY_RED"]: ("red", 555, 390),
13                 KEYIDS["KEY_BLUE"]: ("blue", 640, 390),
14                 KEYIDS["KEY_GREEN"]: ("green", 585, 390),
15                 KEYIDS["KEY_YELLOW"]: ("yellow", 610, 390),
16                 KEYIDS["KEY_MENU"]: ("menu", 645, 290),
17                 KEYIDS["KEY_LEFT"]: ("left", 565, 320),
18                 KEYIDS["KEY_RIGHT"]: ("right", 630, 320),
19                 KEYIDS["KEY_VIDEO"]: ("video", 645, 355),
20                 KEYIDS["KEY_INFO"]: ("info", 550, 290),
21                 KEYIDS["KEY_AUDIO"]: ("audio", 555, 355),
22                 KEYIDS["KEY_TV"]: ("tv", 560, 425),
23                 KEYIDS["KEY_RADIO"]: ("radio", 585, 425)
24         }
25
26 def addKeyBinding(key, context, action):
27         if (context, action) in keyBindings:
28                 keyBindings[(context, action)].append(key)
29         else:
30                 keyBindings[(context, action)] = [key]
31
32 def queryKeyBinding(context, action):
33         if (context, action) in keyBindings:
34                 return keyBindings[(context, action)]
35         else:
36                 return [ ]
37
38 def getKeyDescription(key):
39         if key in keyDescriptions:
40                 return keyDescriptions.get(key, [ ])