(self)
Get the state of the controller represented by this object
Get the state of the controller represented by this object
Get the state of the controller represented by this object
def get_state(self):
        "Get the state of the controller represented by this object"
        state = XINPUT_STATE()
        res = xinput.XInputGetState(self.device_number, ctypes.byref(state))
        if res == ERROR_SUCCESS:
            return state
        if res != ERROR_DEVICE_NOT_CONNECTED:
            raise RuntimeError(
                "Unknown error %d attempting to get state of device %d" % (res, self.device_number))
def get_state ( self ) : state = XINPUT_STATE ( ) res = xinput . XInputGetState ( self . device_number , ctypes . byref ( state ) ) if res == ERROR_SUCCESS : return state if res != ERROR_DEVICE_NOT_CONNECTED : raise RuntimeError ( "Unknown error %d attempting to get state of device %d" % ( res , self . device_number ) )