Advantech RSB-4210 Evaluation Kit Manual de usuario Pagina 102

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 104
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 101
RSB-4210 User Manual 94
evdev is the generic input event interface. It passes the events generated in the
kernel straight to the program, with timestamps. The API is still evolving, but
should be useable now.
This should be the way for GPM and X to get keyboard and mouse events. It
allows for multihead in X without any specific multihead kernel support. The event
codes are the same on all architectures and are hardware independent.
The devices are in /dev/input:
crw-r--r-- 1 root root 13, 64 Apr 1 10:49
event0
crw-r--r-- 1 root root 13, 65 Apr 1 10:50
event1
crw-r--r-- 1 root root 13, 66 Apr 1 10:50
event2
crw-r--r-- 1 root root 13, 67 Apr 1 10:50
event3
...
And so on up to event31.
3. Verifying if it works
Typing a couple keys on the keyboard should be enough to check that a USB key-
board works and is correctly connected to the kernel keyboard driver.
Doing a cat /dev/input/mouse0 (c, 13, 32) will verify that a mouse is also emulated,
characters should appear if you move it.
You can test the joystick emulation with the 'jstest' utility, available in the joystick
package (see Documentation/input/joystick.txt).
You can test the event devices with the 'evtest' utility available in the LinuxConsole
project CVS archive (see the URL below).
4. Event interface
Should you want to add event device support into any application (X, gpm, svgalib ...)
I <vojtech@ucw.cz> will be happy to provide you any help I can. Here goes a
description of the current state of things, which is going to be extended, but not
changed incompatibly as time goes:
You can use blocking and nonblocking reads, also select() on the /dev/input/eventX
devices, and you'll always get a whole number of input events on a read. Their layout
is:
struct input_event {
struct timeval time;
unsigned short type;
unsigned short code;
unsigned int value;
};
'time' is the timestamp, it returns the time at which the event happened.
Type is for example EV_REL for relative moment, EV_KEY for a keypress or release.
More types are defined in include/linux/input.h.
'code' is event code, for example REL_X or KEY_BACKSPACE, again a complete list
is in include/linux/input.h.
'value' is the value the event carries. Either a relative change for EV_REL, absolute
new value for EV_ABS (joysticks ...), or 0 for EV_KEY for release, 1 for keypress and
2 for autorepeat.
Vista de pagina 101
1 2 ... 97 98 99 100 101 102 103 104

Comentarios a estos manuales

Sin comentarios