HP PRIME: TOUCHSCREEN



#2

Hi everyone !

The screen size is 320x240 pixels, so the touchscreen's limits are from pixel (0,0) to pixel (319,239). Right ?

Try this code please:

EXPORT TOUCHZONE()
BEGIN
LOCAL s,white:=#FFFFFFh,grey:=#707070h;
RECT_P(G0,0,0,319,219,grey);
WHILE GETKEY()<> 4 DO // Escape to quit
CASE
// +++++ one finger
IF (MOUSE(0)<>-1 AND MOUSE(1)<>-1) AND
(MOUSE(5)==-1 AND MOUSE(6)==-1)
THEN
s:="X: "+B->R(MOUSE(0));
TEXTOUT_P(s,G0,20,0,2,white,90,grey);
s:="Y: "+B->R(MOUSE(1));
TEXTOUT_P(s,G0,20,18,2,white,90,grey);
s:="Xo: "+B->R(MOUSE(2));
TEXTOUT_P(s,G0,20,36,2,white,90,grey);
s:="Yo: "+B->R(MOUSE(3));
TEXTOUT_P(s,G0,20,54,2,white,90,grey);
s:="Type: "+B->R(MOUSE(4));
TEXTOUT_P(s,G0,20,72,2,white,90,grey);
END;
// +++++ no finger
IF (MOUSE(0)==-1 AND MOUSE(1)==-1) AND
(MOUSE(5)==-1 AND MOUSE(6)==-1) THEN
RECT_P(G0,0,0,319,219,grey);
END;
// +++++ two fingers
IF MOUSE(0)<>-1 AND MOUSE(1)<>-1 AND
MOUSE(5)<>-1 AND MOUSE(6)<>-1
THEN
s:="X: "+B->R(MOUSE(5));
TEXTOUT_P(s,G0,170,0,2,white,90,grey);
s:="Y: "+B->R(MOUSE(6));
TEXTOUT_P(s,G0,170,18,2,white,90,grey);
s:="Xo: "+B->R(MOUSE(7));
TEXTOUT_P(s,G0,170,36,2,white,90,grey);
s:="Yo: "+B->R(MOUSE(8));
TEXTOUT_P(s,G0,170,54,2,white,90,grey);
s:="Type: "+B->R(MOUSE(9));
TEXTOUT_P(s,G0,170,72,2,white,90,grey);
END;
DEFAULT
END;
END;
END;

On my Prime X cannot be less than 2, the same for Y; touchscreen works from (2,2) to (319,239)...

And on yours ?

Dam.


Edited: 11 Nov 2013, 11:25 a.m.


Possibly Related Threads...
Thread Author Replies Views Last Post
  What was the Earliest Touchscreen Handheld? Jake Schwartz 8 219 04-20-2009, 06:14 AM
Last Post: Bill (Smithville, NJ)

Forum Jump: