コード例 #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)