- def list_actions(self, surface):
- # FIXME: Todo
- print("bouh", self.key_sym)
- surface.fill((255, 0, 0))
+ def list_actions(self, screen):
+ action_descriptions = [action.description() for action in self.actions]
+ #print("actions linked to key {}:".format(self.key_sym))
+ #print("\t" + "\n\t".join(action_descriptions))
+ self.draw_lock.acquire()
+ surface = pygame.Surface((690, 250)).convert()
+ surface.fill((250, 250, 250))
+ police = font(14)
+
+ offset = 0
+ police.set_bold(True)
+ text = police.render("actions linked to key {}:".format(self.key_sym), True, (0,0,0))
+ surface.blit(text, (0, offset))
+ offset += police.get_linesize()
+
+ police.set_bold(False)
+ for description in action_descriptions:
+ text = police.render(description, True, (0,0,0))
+ surface.blit(text, (0, offset))
+ offset += police.get_linesize()
+
+ screen.blit(surface, (5, 308))
+ pygame.display.flip()
+ self.draw_lock.release()