SPL Work Station Console Module This Module provides an interface to the NetBSD wscons HID devices. Currently this is meant to be used with input devices only, like mouse and keyboard.builtin wscons_open(devicefile);
builtin wscons_open(devicefile);
Opens a wscons device, the device filename should be provided as parameter.
Check if one ore more events can be read from wscons device. Returns 1 if data is available and undef otherwise.
Read an event from the wscons device, the structure is similar
to that of struct wscons_event; found in /dev/wscons/wsconsio.h
Event time is provided in a time child node containing seconds and nanoseconds.
On return you should check if the type child node is declared.
Example:
var mouse = wscons_open("/dev/wsmouse0");
//...
if (wscons_poll(mouse) == 1)
{
var event = wscons_read(mouse);
if (declared event.type)
{
debug "event type: " ~ event.type;
debug "event value: " ~ event.value;
debug "event time (seconds): " ~ event.time.seconds;
debug "event time (nanoseconds): " ~ event.time.nanoseconds;
}
else
{
warning "could not read data although wscons_poll() succeeded";
}
}
else
{
debug "no data available from wscons device";
}
wscons_close(mouse);
| Generated by SPLDOC. | http://www.clifford.at/spl/ |