LoginLogin

Touch pad

Root / Programming Questions / [.]

KHypnoCreated:
Im trying to make a cursor be controlled with a trackpad. I want it to be like a laptop where it adds the position to the current position (I cant really explain it) and not just equal the touch screen.

Try something like this:
ACLS
SPSET 0,0
WHILE 1
 VSYNC

 TOUCH OUT T,TX,TY
 IF T && OLD_T THEN
  X=X+(TX-OLD_TX)
  Y=Y+(TY-OLD_TY)
 ENDIF
 OLD_TX=TX
 OLD_TY=TY
 OLD_T=T

 SPOFS 0,X,Y
WEND

Thank you, but what does T && OLD_T mean?

Thank you, but what does T && OLD_T mean?
T=How long the screen has been touched

I'm talking about the &&

&& checks if both values are not 0