(cls, *devices, **kwargs)
return cls(events=all_capabilities, **kwargs)
Create an UInput device with the capabilities of one or more input
        devices.

        Arguments
        ---------
        devices : InputDevice|str
          Varargs of InputDevice instances or paths to input devices.

        filtered_types : Tuple[event type codes]
          Event types to exclude from the capabilities of the uinput device.

        **kwargs
          Keyword arguments to UInput constructor (i.e. name, vendor etc.).
Create an UInput device with the capabilities of one or more input
        devices.
Create an UInput device with the capabilities of one or more input devices .
def from_device(cls, *devices, **kwargs):
        '''
        Create an UInput device with the capabilities of one or more input
        devices.

        Arguments
        ---------
        devices : InputDevice|str
          Varargs of InputDevice instances or paths to input devices.

        filtered_types : Tuple[event type codes]
          Event types to exclude from the capabilities of the uinput device.

        **kwargs
          Keyword arguments to UInput constructor (i.e. name, vendor etc.).
        '''

        # TODO: Move back to the argument list once Python 2 support is dropped.
        filtered_types = kwargs.pop('filtered_types', (ecodes.EV_SYN, ecodes.EV_FF))

        device_instances = []
        for dev in devices:
            if not isinstance(dev, device.InputDevice):
                dev = device.InputDevice(str(dev))
            device_instances.append(dev)

        all_capabilities = defaultdict(set)

        # Merge the capabilities of all devices into one dictionary.
        for dev in device_instances:
            for ev_type, ev_codes in dev.capabilities().items():
                all_capabilities[ev_type].update(ev_codes)

        for evtype in filtered_types:
            if evtype in all_capabilities:
                del all_capabilities[evtype]

        return cls(events=all_capabilities, **kwargs)
def from_device ( cls , * devices , * * kwargs ) : # TODO: Move back to the argument list once Python 2 support is dropped. filtered_types = kwargs . pop ( 'filtered_types' , ( ecodes . EV_SYN , ecodes . EV_FF ) ) device_instances = [ ] for dev in devices : if not isinstance ( dev , device . InputDevice ) : dev = device . InputDevice ( str ( dev ) ) device_instances . append ( dev ) all_capabilities = defaultdict ( set ) # Merge the capabilities of all devices into one dictionary. for dev in device_instances : for ev_type , ev_codes in dev . capabilities ( ) . items ( ) : all_capabilities [ ev_type ] . update ( ev_codes ) for evtype in filtered_types : if evtype in all_capabilities : del all_capabilities [ evtype ] return cls ( events = all_capabilities , * * kwargs )