code: def emit(self, report):
          
          for name, attr in self.layout.axes.items():
              value = getattr(report, attr)
              self.write_event(ecodes.EV_ABS, name, value)
  
          for name, attr in self.layout.buttons.items():
              attr, modifier = attr
  
              if attr in self.ignored_buttons:
                  value = False
              else:
                  value = getattr(report, attr)
  
              if modifier and "analog" in attr:
                  if modifier == "+":
                      value = value > (128 + DEFAULT_A2D_DEADZONE)
                  elif modifier == "-":
                      value = value < (128 - DEFAULT_A2D_DEADZONE)
  
              self.write_event(ecodes.EV_KEY, name, value)
  
          for name, attr in self.layout.hats.items():
              if getattr(report, attr[0]):
                  value = -1
              elif getattr(report, attr[1]):
                  value = 1
              else:
                  value = 0
  
              self.write_event(ecodes.EV_ABS, name, value)
  
          self.device.syn()
docs: Writes axes, buttons and hats with values from the report to
          the device.