Hello Jim,
Events, like pen events, are trapped with a DOEVENTS or WAITEVENT function.
If either of these two functions returns the 1000 value, then a pen event occured.
Now, you just have to find out what happened.
If the PENDOWN function returned 1 (meaning true) the previous time a pen event had occured, and if it is still returning true, then the pen is still down and it is very probable that it moved.
If it just returned 0 (meaning false) and you had trapped that it was down before, then the pen was just lifted and you know that you have to stop drawing.
If one of the two PENX and PENY returns a different value than previously (meaning during the last event returning 1000), then the pen moved to the new (x,y) position returned by PENX and PENY.
So, to sum up:
1. track if a pen event occured with DOEVENTS or WAITEVENT
2. check if the pen is down or up with PENDOWN
3. check the position of the pen with PENX and PENY
4. compare returned values of PENDOWN, PENX and PENY with the values returned the last time a pen event has occured and code accordingly to what you want to do.
iBChristmas and NekoCat are two sample applications shipped with iziBasic and they do use these functions. So, you might want to give a look to their source codes.
And, if you want, I could give you a quick dirty source code here (the one I used to check that these functions work well!) to build a drawing application
Cheers
@+
aldweb