self.mapping.finished_running(self, start_time)
- 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((800, 250)).convert()
+ surface.fill((250, 250, 250))
+ if getattr(sys, 'frozen', False):
+ police = pygame.font.Font(sys._MEIPASS + "/Ubuntu-Regular.ttf", 14)
+ else:
+ police = pygame.font.Font("Ubuntu-Regular.ttf", 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, (10, 330))
+ pygame.display.flip()
+ self.draw_lock.release()