Specifications

CARROLL TOUCH Appendix D - CTKERN Function Reference
Touch System Programmer’s Guide D-37
SetUserEventHandlerMode (23)
Description
This function sets the user event handler (UEH) mode, which lets you
install an event handler subroutine that is called whenever the touch
state changes.
It also allows a user application to receive reports from the CTKERN
driver using an interrupt mode rather than a polling mode. 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 touch state changes.
When the UEH is called, the CPU registers contain the following:
BH = Z-axis touch pressure.
BL = Touch state.
0 = Not touched (x, y set to last place screen was
touched).
1 = Touched (x, y set to where the screen is touched).
2 = Non-contiguous (x, y undefined).
CX = X coordinate.
DX = Y coordinate.
These parameters are the same as those in the GetTouchState (1)
function.
When the event handler subroutine returns, the execution of the user
program continues at the point at which it was interrupted.
Call with
AL = 23 (function number).
BL = User event handler mode.
00 = User event handler disabled.
01 = User event handler enabled.