GLBasic forum

Main forum => GLBasic - en => Topic started by: mookmac on 2008-Jan-19

Title: GP2X f200 touchscreen
Post by: mookmac on 2008-Jan-19
does the mousestate command apply to the touchscreen on the GP2X f200? e.g. can i use the same code that works for the mouse on my pc to also work for the stylus on the gp2x? also is a tap on the screen relitive to button 1 on a mouse? hope its clear what im asking. thnaks for your help
Title: GP2X f200 touchscreen
Post by: Ian Price on 2008-Jan-19
Simple answer is yes. B1 (left mouse button) is the same as touching the screen.
Title: GP2X f200 touchscreen
Post by: mookmac on 2008-Jan-19
how can i put in a pause which waits for either key or mouse press? i've tried mousewait but it only moves on with a mouse click.
Title: GP2X f200 touchscreen
Post by: D2O on 2008-Jan-19
Sorry, bad english ;)

You need this ??
http://www.glbasic.com/forum/viewtopic.php?id=679
Title: GP2X f200 touchscreen
Post by: mookmac on 2008-Jan-19
not really, i need a way of getting the program to wait for either  a mouse click or a button press. But the only syntax (commands) i can find does only one or the other.
Title: GP2X f200 touchscreen
Post by: PeeJay on 2008-Jan-20
Code (glbasic) Select
IF DOESFILEEXIST("/dev/touchscreen/wm97xx")
MOUSEWAIT
ELSE
KEYWAIT
ENDIF
Title: GP2X f200 touchscreen
Post by: Thunor on 2008-Jan-20
Code (glbasic) Select
FUNCTION inputwait:
LOCAL mx, my, mb1, mb2
LOCAL count, quit = FALSE

WHILE quit = FALSE
MOUSESTATE mx, my, mb1, mb2
IF mb1 = TRUE THEN quit = TRUE
FOR count = 0 TO 255
IF KEY(count) = TRUE THEN quit = TRUE
NEXT
WEND
ENDFUNCTION