def EVIOCGLED(length): return _IOC(_IOC_READ, 69, 0x19, length) # get all LEDs */
def EVIOCGBIT(evtype, length=255): return _IOC(_IOC_READ, 69, 0x20 + evtype, length) # get event bits */
def EVIOCGSW(length): return _IOC(_IOC_READ, 69, 0x1b, length) # get all switch states */
SHORT4 = "hhhh" SIZEOF_INT2 = struct.calcsize(INT2) # Initialize the ioctl constants from ioctl import _IOC, _IO, _IOW, _IOR, _IOC_READ # taken from /usr/include/linux/input.h EVIOCGVERSION = _IOR(69, 0x01, INT) # get driver version */ EVIOCGID = _IOR(69, 0x02, SHORT4) # get device ID */ EVIOCGREP = _IOR(69, 0x03, INT2) # get repeat settings */ EVIOCSREP = _IOW(69, 0x03, INT2) # set repeat settings */ EVIOCGKEYCODE = _IOR(69, 0x04, INT2) # get keycode */ EVIOCSKEYCODE = _IOW(69, 0x04, INT2) # set keycode */ EVIOCGKEY = _IOR(69, 0x05, INT2) # get key value */ EVIOCGNAME = _IOC(_IOC_READ, 69, 0x06, 255) # get device name */ EVIOCGPHYS = _IOC(_IOC_READ, 69, 0x07, 255) # get physical location */ EVIOCGUNIQ = _IOC(_IOC_READ, 69, 0x08, 255) # get unique identifier */ EVIOCRMFF = _IOW(69, 0x81, INT) # Erase a force effect */ EVIOCSGAIN = _IOW(69, 0x82, USHORT) # Set overall gain */ EVIOCSAUTOCENTER = _IOW(69, 0x83, USHORT) # Enable or disable auto-centering */ EVIOCGEFFECTS = _IOR( 69, 0x84, INT) # Report number of effects playable at the same time */ EVIOCGRAB = _IOW(69, 0x90, INT) # Grab/Release device */ class Queue(deque): def push(self, obj): self.appendleft(obj)
SHORT4 = "hhhh" SIZEOF_INT2 = struct.calcsize(INT2) # Initialize the ioctl constants from ioctl import _IOC, _IO, _IOW, _IOR, _IOC_READ # taken from /usr/include/linux/input.h EVIOCGVERSION = _IOR(69, 0x01, INT) # get driver version */ EVIOCGID = _IOR(69, 0x02, SHORT4) # get device ID */ EVIOCGREP = _IOR(69, 0x03, INT2) # get repeat settings */ EVIOCSREP = _IOW(69, 0x03, INT2) # set repeat settings */ EVIOCGKEYCODE = _IOR(69, 0x04, INT2) # get keycode */ EVIOCSKEYCODE = _IOW(69, 0x04, INT2) # set keycode */ EVIOCGKEY = _IOR(69, 0x05, INT2) # get key value */ EVIOCGNAME = _IOC(_IOC_READ, 69, 0x06, 255)# get device name */ EVIOCGPHYS = _IOC(_IOC_READ, 69, 0x07, 255)# get physical location */ EVIOCGUNIQ = _IOC(_IOC_READ, 69, 0x08, 255)# get unique identifier */ EVIOCRMFF = _IOW(69, 0x81, INT) # Erase a force effect */ EVIOCSGAIN = _IOW(69, 0x82, USHORT) # Set overall gain */ EVIOCSAUTOCENTER= _IOW(69, 0x83, USHORT) # Enable or disable auto-centering */ EVIOCGEFFECTS = _IOR(69, 0x84, INT) # Report number of effects playable at the same time */ EVIOCGRAB = _IOW(69, 0x90, INT) # Grab/Release device */ class Queue(deque): def push(self, obj): self.appendleft(obj)