Beispiel #1
0
INT2 = "ii"
INT5 = "iiiii"
SHORT = "h"
USHORT = "H"
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 */

Beispiel #2
0
INT2 = "ii"
INT5 = "iiiii"
SHORT = "h"
USHORT = "H"
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):
Beispiel #3
0
import fcntl
import ioctl
import os
import select

from echomesh.util import Log

from pi3d.event.Constants import *

from pi3d.event import AbsAxisScaling
from pi3d.event import EventStruct
from pi3d.event import Format

LOGGER = Log.logger(__name__)

EVIOCGRAB = ioctl._IOW(ord('E'), 0x90, "i")  # Grab/Release device


class EventStream(object):
    """
  encapsulates the event* file handling

  Each device is represented by a file in /dev/input called eventN, where N is
  a small number. (Actually, a keybaord is/can be represented by two such files.)
  Instances of this class open one of these files and provide means to read
  events from them.

  Class methods also exist to read from multiple files simultaneously, and
  also to grab and ungrab all instances of a given type.
  """
    AllStreams = []
Beispiel #4
0
CRK_ALGORITHM_MAX = (CRK_ALGORITHM_ALL - 1)

# features to be queried with CIOCASYMFEAT ioctl

CRF_MOD_EXP = (1 << CRK_MOD_EXP)
CRF_MOD_EXP_CRT = (1 << CRK_MOD_EXP_CRT)
CRF_DSA_SIGN = (1 << CRK_DSA_SIGN)
CRF_DSA_VERIFY = (1 << CRK_DSA_VERIFY)
CRF_DH_COMPUTE_KEY = (1 << CRK_DH_COMPUTE_KEY)

# ioctl's. Compatible with old linux cryptodev.h

CRIOGET = _IOWR(ord('c'), 101, sizeof(c_uint32))
CIOCGSESSION = _IOWR(ord('c'), 102, sizeof(session_op))
CIOCFSESSION = _IOW(ord('c'), 103, sizeof(c_uint32))
CIOCCRYPT = _IOWR(ord('c'), 104, sizeof(crypt_op))
CIOCKEY = _IOWR(ord('c'), 105, sizeof(crypt_kop))
CIOCASYMFEAT = _IOR(ord('c'), 106, sizeof(c_uint32))
CIOCGSESSINFO = _IOWR(ord('c'), 107, sizeof(session_info_op))

# to indicate that CRIOGET is not required in linux

CRIOGET_NOT_NEEDED = 1

# additional ioctls for AEAD
CIOCAUTHCRYPT = _IOWR(ord('c'), 109, sizeof(crypt_auth_op))

# additional ioctls for asynchronous operation.
# These are conditionally enabled since version 1.6.
Beispiel #5
0
import fcntl
import ioctl
import os
import select

from echomesh.util import Log

from pi3d.event.Constants import *

from pi3d.event import AbsAxisScaling
from pi3d.event import EventStruct
from pi3d.event import Format

LOGGER = Log.logger(__name__)

EVIOCGRAB = ioctl._IOW(ord('E'), 0x90, "i")          # Grab/Release device

class EventStream(object):
  """
  encapsulates the event* file handling

  Each device is represented by a file in /dev/input called eventN, where N is
  a small number. (Actually, a keybaord is/can be represented by two such files.)
  Instances of this class open one of these files and provide means to read
  events from them.

  Class methods also exist to read from multiple files simultaneously, and
  also to grab and ungrab all instances of a given type.
  """
  AllStreams = [ ]
  axisX = 0