예제 #1
0
def EVIOCGLED(length):
    return _IOC(_IOC_READ, 69, 0x19, length)  #  get all LEDs */
예제 #2
0
def EVIOCGBIT(evtype, length=255):
    return _IOC(_IOC_READ, 69, 0x20 + evtype, length)  # get event bits */
예제 #3
0
def EVIOCGSW(length):
    return _IOC(_IOC_READ, 69, 0x1b, length)  # get all switch states */
예제 #4
0
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)
예제 #5
0
파일: Input.py 프로젝트: cc1-cloud/cc1
def EVIOCGLED(length):
    return _IOC(_IOC_READ, 69, 0x19, length)   #  get all LEDs */
예제 #6
0
파일: Input.py 프로젝트: cc1-cloud/cc1
def EVIOCGSW(length):
    return _IOC(_IOC_READ, 69, 0x1b, length)   # get all switch states */
예제 #7
0
파일: Input.py 프로젝트: cc1-cloud/cc1
def EVIOCGBIT(evtype, length=255):
    return _IOC(_IOC_READ, 69, 0x20 + evtype, length)  # get event bits */
예제 #8
0
파일: Input.py 프로젝트: cc1-cloud/cc1
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)