TB(4) —
NAME
tb − line discipline for digitizing devices
SYNOPSIS
pseudo-device tb
DESCRIPTION
This line discipline provides a polled interface to many common digitizing devices (e.g. mouse and tablet) connected to a host. When these devices stream data at high speed, the use of the line discipline is critical in minimizing the number of samples that would otherwise be lost due to buffer exhaustion in the tty(4) handler.
The line discipline is enabled by a sequence:
#include <sys/ioctl.h>
#include <sys/tbioctl.h>
int ldisc = TABLDISC, fildes; ...
ioctl(fildes, TIOCSETD, &ldisc);
A typical application program then polls the digitizing device by reading a binary data structure which contains: the current X and Y positions (in the device coordinate space), up-down status of the buttons or pen stylus, proximity information (when available), and a count of the number of samples received from the input device since it was opened. Refer to the include file for a complete description.
The line discipline supports ioctl(2) requests to get/set the operating mode, and to get/set the tablet type and operating mode by or-ing the two values together.
The mouse format returned by tb(4) is:
struct tbmspos {
intxpos;/∗ delta x, positive to the right ∗/
intypos;/∗ delta y, positive up ∗/
shortstatus;/∗ button status ∗/
#defineMIDDLE_BUTTON0x2
#define RIGHT_BUTTON0x4
#defineLEFT_BUTTON0x0
#defineNO_BUTTON0xOV
shortscount;/∗ running count of the number of events reported∗/
}
SEE ALSO
DIAGNOSTICS
None.
PRPQs 5799-WZQ/5799-PFF: IBM/4.3 — July 1987