Esempio n. 1
0
 def addInputDevice(self, device: InputDevice) -> None:
     name = device.getId()
     if name not in self._input_devices:
         self._input_devices[name] = device
         device.event.connect(self.event)
     else:
         Logger.log(
             "w",
             "%s was already added to input device list. Unable to add it again."
             % name)
Esempio n. 2
0
    def addInputDevice(self, device: InputDevice) -> None:
        """Add an input device (e.g. mouse, keyboard, etc) if it's not already added.

        :param device: The input device to be added
        """

        name = device.getId()
        if name not in self._input_devices:
            self._input_devices[name] = device
            device.event.connect(self.event)
        else:
            Logger.log("w", "%s was already added to input device list. Unable to add it again." % name)