ebmDevMag.com home
ebm Developer's Magazine
links

developer's mag
main page

article
part 1
part 2
part 3
part 4
part 5
part 6
part 7
part 8


2 - About Keys and Event Loops

Ultimately, all ebm GUI programs rely heavily on the message loop. In the familiar MsgHandler() function, the MSG_TYPE value 'MSG_KEY' is the message relating to keystrokes, with the actual key code stored in the data value (the S32 parameter).

The key message loop doesn't just handle ordinary keystrokes entered via the bottom text entry pad. Several other objects on the ebm masquerade as keys, allowing you to use the same message loop to monitor these extra user interfaces. To avoid confusing them with character codes, the special values are larger than 255. The silk-screened display at the bottom and the jog wheel each have specific key codes associated with them, and are defined in /franklin/SDK/sneak32/include/gui_types.h.

Firstly, the jog wheel can be detected with the following:

  • K_JOG_UP - Pressing the jog wheel up.
  • K_JOG_DOWN - Pressing the jog wheel down.
  • K_JOG_ENTER - Pushing in the jog wheel button while centered.

The silk-screened cursor pad at the bottom right has the following keys associated with it:

  • K_LEFT - Pressing on the left side of the cursor arrow pad.
  • K_RIGHT- Pressing on the right side.
  • K_UP - Pressing on the upward arrow, near the center.
  • K_PAGE_UP - Like K_UP, pressing on the up arrow, but nearer the top.
  • K_DOWN - Down arrow of the cursor display, near the center.
  • K_PAGE_DOWN - Down arrow, nearer the bottom.

Additional pad key codes are:

  • K_MENU - The menu silk-screen button
  • K_KEYBOARD - Generated by making the vertical swipe from the text entry area onto the ebm screen.

There are also key codes associated with data entry, which need no description:

  • K_ENTER
  • K_DELETE
  • K_BACKSPACE

To round out the list of defines, there are several that you should never encounter with the ebm's hardware, but which you might see mentioned from time to time:

  • K_TOP
  • K_BOTTOM
  • K_JOG_PAGE_DOWN
  • K_JOG_PAGE_UP


Previous Section
Next Section

Copyright © 2001-2006 ebmDevMag.com - Legal Notice