(self, dev)
Arguments
        ---------
        dev : str|bytes|PathLike
          Path to input device
Arguments
        ---------
        dev : str|bytes|PathLike
          Path to input device
Arguments --------- dev : str|bytes|PathLike Path to input device
def __init__(self, dev):
        '''
        Arguments
        ---------
        dev : str|bytes|PathLike
          Path to input device
        '''

        #: Path to input device.
        self.path = dev if not hasattr(dev, '__fspath__') else dev.__fspath__()

        # Certain operations are possible only when the device is opened in
        # read-write mode.
        try:
            fd = os.open(dev, os.O_RDWR | os.O_NONBLOCK)
        except OSError:
            fd = os.open(dev, os.O_RDONLY | os.O_NONBLOCK)

        #: A non-blocking file descriptor to the device file.
        self.fd = fd

        # Returns (bustype, vendor, product, version, name, phys, capabilities).
        info_res = _input.ioctl_devinfo(self.fd)

        #: A :class:`DeviceInfo <evdev.device.DeviceInfo>` instance.
        self.info = DeviceInfo(*info_res[:4])

        #: The name of the event device.
        self.name = info_res[4]

        #: The physical topology of the device.
        self.phys = info_res[5]

        #: The unique address of the device.
        self.uniq = info_res[6]

        #: The evdev protocol version.
        self.version = _input.ioctl_EVIOCGVERSION(self.fd)

        #: The raw dictionary of device capabilities - see `:func:capabilities()`.
        self._rawcapabilities = _input.ioctl_capabilities(self.fd)

        #: The number of force feedback effects the device can keep in its memory.
        self.ff_effects_count = _input.ioctl_EVIOCGEFFECTS(self.fd)
def __init__ ( self , dev ) : #: Path to input device. self . path = dev if not hasattr ( dev , '__fspath__' ) else dev . __fspath__ ( ) # Certain operations are possible only when the device is opened in # read-write mode. try : fd = os . open ( dev , os . O_RDWR | os . O_NONBLOCK ) except OSError : fd = os . open ( dev , os . O_RDONLY | os . O_NONBLOCK ) #: A non-blocking file descriptor to the device file. self . fd = fd # Returns (bustype, vendor, product, version, name, phys, capabilities). info_res = _input . ioctl_devinfo ( self . fd ) #: A :class:`DeviceInfo <evdev.device.DeviceInfo>` instance. self . info = DeviceInfo ( * info_res [ : 4 ] ) #: The name of the event device. self . name = info_res [ 4 ] #: The physical topology of the device. self . phys = info_res [ 5 ] #: The unique address of the device. self . uniq = info_res [ 6 ] #: The evdev protocol version. self . version = _input . ioctl_EVIOCGVERSION ( self . fd ) #: The raw dictionary of device capabilities - see `:func:capabilities()`. self . _rawcapabilities = _input . ioctl_capabilities ( self . fd ) #: The number of force feedback effects the device can keep in its memory. self . ff_effects_count = _input . ioctl_EVIOCGEFFECTS ( self . fd )