(self, event, *args)
Send an event to the processing thread.
        This should also print out what's happening.

        Parameters:
            event (ProcessCommand): Event to send.
Send an event to the processing thread.
        This should also print out what's happening.
Send an event to the processing thread . This should also print out what s happening .
def send_process_event(self, event, *args):
        """Send an event to the processing thread.
        This should also print out what's happening.

        Parameters:
            event (ProcessCommand): Event to send.
        """
        event_messages = {
            ProcessCommand.MouseMove: 'Mouse moved: {}',
            ProcessCommand.KeyPressed: 'Key pressed: {} (x{})',
            ProcessCommand.KeyHeld: 'Key held: {}',
            ProcessCommand.KeyReleased: 'Key released: {}',
            ProcessCommand.GamepadButtonPressed: 'Gamepad {} button pressed: {} (x{})',
            ProcessCommand.GamepadButtonHeld: 'Gamepad {} button held: {}',
            ProcessCommand.GamepadButtonReleased: 'Gamepad {} button released: {}',
            ProcessCommand.GamepadThumbL: 'Gamepad {} left thumbstick moved: {}',
            ProcessCommand.GamepadThumbR: 'Gamepad {} right thumbstick moved: {}',
            ProcessCommand.GamepadTriggerL: 'Gamepad {} left trigger moved: {}',
            ProcessCommand.GamepadTriggerR: 'Gamepad {} right trigger moved: {}',
        }
        if event in event_messages:
            print(event_messages[event].format(*args))
        elif event == ProcessCommand.MonitorChanged:
            monitor_data = args[0]
            resolutions = ('{}x{}'.format(x2-x1, y2-y1) for x1, y1, x2, y2 in monitor_data)
            coordinates = ((x1, y1) for x1, y1, x2, y2 in monitor_data)
            monitor_str = ', '.join('{} at {}'.format(*i) for i in zip(resolutions, coordinates))
            print('Monitor setup changed: ' + monitor_str)

        self.process_sender.put((event, args))
def send_process_event ( self , event , * args ) : event_messages = { ProcessCommand . MouseMove : 'Mouse moved: {}' , ProcessCommand . KeyPressed : 'Key pressed: {} (x{})' , ProcessCommand . KeyHeld : 'Key held: {}' , ProcessCommand . KeyReleased : 'Key released: {}' , ProcessCommand . GamepadButtonPressed : 'Gamepad {} button pressed: {} (x{})' , ProcessCommand . GamepadButtonHeld : 'Gamepad {} button held: {}' , ProcessCommand . GamepadButtonReleased : 'Gamepad {} button released: {}' , ProcessCommand . GamepadThumbL : 'Gamepad {} left thumbstick moved: {}' , ProcessCommand . GamepadThumbR : 'Gamepad {} right thumbstick moved: {}' , ProcessCommand . GamepadTriggerL : 'Gamepad {} left trigger moved: {}' , ProcessCommand . GamepadTriggerR : 'Gamepad {} right trigger moved: {}' , } if event in event_messages : print ( event_messages [ event ] . format ( * args ) ) elif event == ProcessCommand . MonitorChanged : monitor_data = args [ 0 ] resolutions = ( '{}x{}' . format ( x2 - x1 , y2 - y1 ) for x1 , y1 , x2 , y2 in monitor_data ) coordinates = ( ( x1 , y1 ) for x1 , y1 , x2 , y2 in monitor_data ) monitor_str = ', ' . join ( '{} at {}' . format ( * i ) for i in zip ( resolutions , coordinates ) ) print ( 'Monitor setup changed: ' + monitor_str ) self . process_sender . put ( ( event , args ) )