Specifications
Appendix C - TAPI Function Reference CARROLL TOUCH
 C-14 Touch System Programmer’s Guide
SetUserEventHandler (7)
Description
This function lets you install a user event handler (UEH) subroutine 
that is called whenever a report is available from the driver. This lets a 
user application receive reports from the TAPI driver using an interrupt 
method rather than a polling method. The UEH subroutine should end 
with a normal return instruction, not a return from interrupt instruction.
Once a UEH has been installed and enabled, execution of the user 
program is halted and the event handler subroutine is called whenever 
the TAPI driver has a report to be sent to the user, as long as the bit in 
the event mask that corresponds to the type of report is set. 
When the UEH is called, the CPU registers contain the following:
BX = Segment of the TAPI driver’s internal report buffer.
CX  = Number of report bytes available for transfer.
DX  = Offset of the TAPI driver’s internal report buffer.
The UEH may then read report bytes from the buffer, up to the number 
of bytes in CX. Any bytes read from the buffer beyond the value passed 
in CX are invalid. The UEH must not write to the buffer.
When the event handler subroutine returns, it must load AX as follows:
AX  =  0 = Leave the TAPI driver’s internal report 
buffer intact.
AX  =  Nonzero = Clear the TAPI driver’s internal report 
buffer.
The execution of the user program then continues at the point at which 
it was interrupted.
Call with
AX  = 7 (function number).
BH  = Event mask.
Bit 0= If 1, call handler on all coordinate reports.
Bit 1= If 1, call handler on all non-coordinate reports.
BH: X X
7 6 5 4 3 2 1 0










