> On Wed, 12 Jun 2002, Curt Allen wrote:
> > I was using penx() and peny() in PocketC to acquire the coords 
> > of a screen tap.  Now I'm using CW8.0 and I can't seem to 
> > figure out how to get these coords.  Any help?

--- Aaron Ardiri <[EMAIL PROTECTED]> wrote:
>   EvtGetPen(&penX, *penY, *penDown);

That's rather sloppy cutting and pasting, az!

The prototype for EvtGetPen() is:

  void EvtGetPen (Int16 *pScreenX, Int16 *pScreenY, Boolean *pPenDown);

So, you would use something like this:

  Int16 ScreenX, ScreenY;
  Boolean PenDown;
  EvtGetPen(&ScreenX, &ScreenY, &PenDown);

However, most of the time, you want to get the coords when you receive
a tap on the screen, not just at any random time.  To do that, you
should add code like this to your form event handler:

  case penDownEvent:
    // eventP is the EventPtr passed to your form event handler
    ScreenX = eventP->screenX;
    ScreenY = eventP->screenY;
    // <code to do whatever else you want here>
    handled = false; // to let controls handle their pen events
    break;


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to