(self)
Resets the device to a blank state.
Resets the device to a blank state.
Resets the device to a blank state .
def emit_reset(self):
        """Resets the device to a blank state."""
        for name in self.layout.axes:
            params = self.layout.axes_options.get(name, DEFAULT_AXIS_OPTIONS)
            self.write_event(ecodes.EV_ABS, name, int(sum(params[1:3]) / 2))

        for name in self.layout.buttons:
            self.write_event(ecodes.EV_KEY, name, False)

        for name in self.layout.hats:
            self.write_event(ecodes.EV_ABS, name, 0)

        self.device.syn()
def emit_reset ( self ) : for name in self . layout . axes : params = self . layout . axes_options . get ( name , DEFAULT_AXIS_OPTIONS ) self . write_event ( ecodes . EV_ABS , name , int ( sum ( params [ 1 : 3 ] ) / 2 ) ) for name in self . layout . buttons : self . write_event ( ecodes . EV_KEY , name , False ) for name in self . layout . hats : self . write_event ( ecodes . EV_ABS , name , 0 ) self . device . syn ( )