MOUSE command CLICK type
Hello,
with the following code i am able to detect the key (the ENTER key in this example) to stop the program and some gestures on the touch screen.
What is making me mad is that i can detect the DRAG, the ROTATE and STRETCH but I am not able to detect the simple CLICK!
In reality this is not true since, when i click on the menu RUN to execute the program, it automatically detect a CLICK and then, for the rest of execution i am not able to reproduce again.
At the moment i am interested in the single CLICK not the LONG one...
Code:
EXPORT MAUZ()
BEGIN
LOCAL T,X,Y;
DIMGROB(G1,320,220,RGB(255,120,255));
LINE_P(G1,0,0,400,220,RGB(0,255,255));
LINE_P(G1,0,220,400,0,RGB(0,255,255));
WHILE ISKEYDOWN(30)≠1 DO // STOP ON PRESS ENTER KEY
BLIT_P(G1,0,0,320,220);
T:=MOUSE();
IF SIZE(T(1)) THEN
IF T(1,5)==1 THEN //CLICK DOESN'T WORK
X:=B→R(T(1,1)-T(1,3));
Y:=B→R(T(1,2)-T(1,4));
TEXTOUT_P("X= " + X,G0,10,10);
TEXTOUT_P("Y= " + Y,G0,10,30);
TEXTOUT_P(B→R(T(1)),G0,70,20);
WAIT(3);
END;
IF T(1,5)==2 THEN //2 DRAG WORKS
X:=B→R(T(1,1));
Y:=B→R(T(1,2));
TEXTOUT_P("ΔX= " + X,G0,10,10);
TEXTOUT_P("ΔY= " + Y,G0,10,30);
TEXTOUT_P(B→R(T(1)),G0,70,20);
WAIT(3);
END;
IF T(1,5)==3 THEN //3 STRETCH
X:=B→R(T(1,1));
Y:=B→R(T(1,2));
TEXTOUT_P("X= " + X,G0,10,10);
TEXTOUT_P("Y= " + Y,G0,10,30);
TEXTOUT_P(B→R(T(1)),G0,70,20);
WAIT(3);
END;
IF T(1,5)==4 THEN //4 ROTATE
X:=B→R(T(1,1));
Y:=B→R(T(1,2));
TEXTOUT_P("X= " + X,G0,10,10);
TEXTOUT_P("Y= " + Y,G0,10,30);
TEXTOUT_P(B→R(T(1)),G0,70,20);
WAIT(3);
END;
IF T(1,5)==5 THEN //5 LONG CLICK
X:=B→R(T(1,1));
Y:=B→R(T(1,2));
TEXTOUT_P("X= " + X,G0,10,10);
TEXTOUT_P("Y= " + Y,G0,10,30);
TEXTOUT_P(B→R(T(1)),G0,70,20);
WAIT(3);
END;
END;
END; //FINE WHILE
END;
Any hint?
Thanks
Giancarlo
|