- entry = [ ]
-
- entry.append( (actionmap, context, action) )
- entry.append( (0, 36, 200, 20, 1, 0, "you can also press a secret button") )
- entry.append( (0, 0, 200, 36, 0, 0, help) )
-
+ buttons = queryKeyBinding(context, action)
+
+ # do not display entries which are not accessible from keys
+ if not len(buttons):
+ continue
+
+ name = None
+ flags = 0
+
+ for n in buttons:
+ (name, flags) = (getKeyDescription(n[0]), n[1])
+ if name is not None:
+ break
+
+ if flags & 8: # for long keypresses, prepend l_ into the key name.
+ name = (name[0], "long")
+
+ entry = [ (actionmap, context, action, name ) ]
+
+ if isinstance(help, list):
+ self.extendedHelp = True
+ print "extendedHelpEntry found"
+ entry.extend((
+ (eListboxPythonMultiContent.TYPE_TEXT, 0, 0, 400, 26, 0, 0, help[0]),
+ (eListboxPythonMultiContent.TYPE_TEXT, 0, 28, 400, 20, 1, 0, help[1])
+ ))
+ else:
+ entry.append( (eListboxPythonMultiContent.TYPE_TEXT, 0, 0, 400, 28, 0, 0, help) )
+