Page 1 of 1

PostPosted: Fri Nov 17, 2006 11:49 am
by smoscar_01
why does the functions penx/y() or mousex/y() doesnt seem to retrieve the mouse position?

PostPosted: Thu Nov 23, 2006 10:18 pm
by daparty
I'm not sure what you're running on, but I keyed this program on my Jornada 540 to show you an example of the penx() and peny() functions.

main()
{
int x,y;
string s;
while(1)
{
waitp(); // wait for a pen event
x = penx(); // get value of event PM_BUTTONUP
y = peny(); // get value of event PM_BUTTONUP
clearg(); // clear graphics screen so text doesn't overlap
s = "x=" + x + " y=" + y; // creat string
text(25, 25, s); // print string
}
}

After you build and run the program, tap the screen in different places and their x, y values will print on the screen.

The functions penx() and peny() are pen events and the function
waitp() waits for a pen event;

Hope this helps.

Dave.