Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

poll(2)

dials(3)

TABLET(3)  —  

NAME

tablet − subroutines for accessing the tablet

SYNOPSIS

fd = OpenTablet();
success = ReadTablet(block, last_flag)
int block[3];

DESCRIPTION

These routines should be used to open and read the tablet.  OpenTablet returns a file descriptor appropriate for poll(2). Error return is indicated by a −1 value, and errno will be valid. 

Each call to ReadTablet returns a one on successful read of the tablet.  It will wait for one sample to arrive if there are none waiting at the time of the call.  A zero return is possible if the tablet gets out of synchronization with the system. 

The block argument is a three integer array: the first returned integer is zero or one, if the pen is up or down respectively; the second returned integer is the X position of the pen; and, the third returned integer is the Y position of the pen.  The X and Y positions are in units of .001 inch, and range up to about 11500 in X and 8500 in Y.

The last_flag argument directs ReadTablet to look ahead and return the last sample (if True), or to simply return the next sample (if False).  If last_flag is false, the application should read all pending samples itself (use poll(2)) quickly otherwise the tablet input will overrun the available input buffer and samples may be lost. 

The tablet is set up in incremental run mode where samples are generated continuously while the sample data is changing (either from stylus motion or up/down changes).  Samples are generated at a maximum rate of 50 per second. 

SEE ALSO

poll(2), dials(3)

September 02, 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026