コード例 #1
0
ファイル: controller.py プロジェクト: Ardnived/Regicide
 def trigger_command(self, key, key_type):
     '''
     A key has been pressed. Check if it is mapped to a command, 
     and send the command activation event if so.
     '''
     command = State.commands().get_action(key, key_type)
     
     if command is not None:
         self.dispatch_event('activate_command', command)
コード例 #2
0
ファイル: game.py プロジェクト: Ardnived/Regicide
 def on_click(self, model, button, modifiers):
     action = State.commands().get(CommandBar.ACTIONS[self.selection_x]).action
     if action is not None:
         action(model)