This post is inspired by a poster on the OnBoardC user group-sorry for the messy graphics, but I haven’t got Visio handy right now.

Anyways, some behaviours(like screen taps, button presses) can not be triggered by API calls. However, one needs to simulate them sometimes-doing this is easy if you understand a bit more about the Palm OS.

The Palm OS itself is based on an event queue. Events are added to the top of the queue when generated, and are taken out at the bottom in order to feed the event handling routines:
queue Creating Palm OS events

The events are stored in a data structure called EventType. The event type stays the same for every kind of event-this is made possible by a C construct called union. More on unions can be found in books, for now, it is enough to treat the union as a block of arbitary data embedded into the structure:
 Creating Palm OS events

From the outside, each event looks the same-just like each of the fish in the comic below looks (almost) equal from the eye of the MS Event:
sea Creating Palm OS events

Adding an event to the queue is very easy-all you need is the Event manager(syntax description by PalmSource). Basically, you create an EventType, set the appropriate fields(think of it as if it were a structure) and add it to the Palm OS event loop.

Usual tricks performed with this call are powering off Palm OS handhelds, simulating screen taps and returning to the launcher.

Any feedback?

Related posts:

  1. WristPDA button handling made easy
  2. Creating/Selling Palm/mobile shareware…what do I need to do
  3. On Un-Responsive Cancel Buttons
  4. Register Now for HP webOS Worldwide Developer Events
  5. Palm unleashes webOS 1.0.3

3 Responses to “Creating Palm OS events”

  1. Useful, you gave me a nice idea, now if only i could get a queue of C commands going in my head

  2. Nice diagrams :P

  3. Hi,
    EvtAddEventToQueue basically is all you need. I am currently traveling, and thus don\’t have any code handy…

    As for Nitron-if you wish to, I can upload hires scans of the diagrams when I get back home!

    Best regards
    Tam Hanna

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting

© 2013 TamsPalm - the Palm OS / web OS Blog Suffusion theme by Sayontan Sinha