Random Projects: Linux iPAQ Projects

These are a few random projects. They range from very useful to totally frivolous. Consider them all to be under the GPL.

INTRO: These are a bunch of snippets of useful python code which I've written for Linux on the iPAQ. I hope they're helpful.

Grabbing Those Pesky Buttons Using Python and gtk: The iPAQ buttons under Linux are mapped to key values. Grabbing them is really no different from grabbing a keypress. The good folks who put together the familiar distribution were kind enough to include the gtk libraries. These enable us to easily write an application which listens for those keycodes.

Basic Procedure:

  1. Create an instance of gtk - self.win = gtk.GtkWindow()
  2. Connect key_press_event to a function - self.win.connect("key_press_event", self.event_callback")
  3. Set up our loop - gtk.timeout_add(self.timeout, self.main_callback). In our example, self.main_callback() calls our loop again.

List of buttoncodes:


Example: buttons.py