Developing in pocketc

Discuss PocketC for CE (including Desktop Edition)

Postby smoscar_01 on Fri Nov 17, 2006 11:49 am

why does the functions penx/y() or mousex/y() doesnt seem to retrieve the mouse position?
Posts: 1
Joined: Thu Nov 16, 2006 1:52 pm
Location: Mexico

Postby daparty on Thu Nov 23, 2006 10:18 pm

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.

int x,y;
string s;
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.

Posts: 7
Joined: Mon Mar 08, 2004 11:44 pm

Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 1 guest