示例#1
0
import fcntl
import os
import select

from pi3d.event.Constants import *

from pi3d.event import ioctl
from pi3d.event import AbsAxisScaling
from pi3d.event import EventStruct
from pi3d.event import Format
from pi3d.util import Log

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
  axisY = 1
示例#2
0
import fcntl
import os
import select

from echomesh.util import Log

from pi3d.event.Constants import *

from pi3d.event import ioctl
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 = []