Deepak.MA wrote:
    I need to track a drag using the stylus on the LCD. i.e., using the
stylus we can grab events when
the screen is tapped with the stylus.
    Can i get to know the co-ordinates where the screen is tapped and the
co-ordinates where the stylus
is pulled up from the screen.

The best way to do this is to use EvtGetPen().  It reads the pen
and bypasses the normal event loop.  You would normally call EvtGetPen()
in response to a penDownEvent, so that you can track the further
movements right after the pen goes down.

The penDownEvent contains the coordinates of the initial tap, so tracking
the pen would look something like this:

        Boolean MyHandleEvent (EventType* eventPtr)
        {
            Int16 penx, peny;
            Int16 penxlast, penylast;
            Boolean pendown;

            if (eventPtr->eType == penDownEvent)
            {
                penx = eventPtr->screenX;
                peny = eventPtr->screenY;

                do
                {
                    /* do something with penx, peny here */

                    penxlast = penx;
                    penylast = peny;
                    EvtGetPen (&penx, &peny, &pendown);
                } while (pendown);

                /* here, penxlast and penylast are the last position
                   of the pen before it was lifted */

                return (true);
            }

            return (false);
        }

Hope that helps...

  - Logan

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

Reply via email to