Coding for Lefty Pilots

how to support left-handed Pilot use

Objective: make your Pilot application just as ergonomically well-designed for users who hold the stylus in their left hand as it is for users who use their right.

Strategy: move control objects which must be dragged to the left of the objects they control -- for example, move scrollbars to the left of the scrolling content area. Leave all other interface elements (buttons, menus, etc.) in their standard positions. See Lefty Pilots for more discussion.

Methods: either use the FrmSetObjectPosition system call directly, or include "Lefty.h" (a header file provided below) and use its higher-level functions to rearrange your form. This should be done after the form is initialized (FrmInitForm) but before it is displayed (FrmDrawForm).

Using FrmSetObjectPosition

This is the built-in system call used for moving objects around on the form. You can use this call to "manually" change the position of objects on your form, so that they're more easily usable by lefties. The syntax of the call is:
	FrmSetObjectPosition(FormPtr frm, Word objIndex, SWord x, SWord y);
The form object is referred to by index, which can be obtained from its unique ID with a call to FrmGetObjectIndex(FormPtr frm, Word objID). And you can get the object's current position with FrmGetObjectPosition(FormPtr frm, Word objIndex, SWordPtr x, SWordPtr y).

Using Lefty.h and Lefty.c

This is a little source code module which you can download by clicking the links above and include in your project. Its purpose is to simplify checking of the Lefty preference setting and rearranging of your form. It includes the following functions:

Most developers will never need to do more than call UserIsLefty to determine if the user is a lefty, and if so, then call LeftySwapByID to swap the position of a scrollbar and its content. If you have additional form objects to shift around, then you may need to use also the other Lefty functions above.

Example. The image at the left shows a modified version of the Memo example in the Examples folder of the SDK. A couple of lines were added to MemoMain.c, in the ApplicationHandleEvent function, in the case where the form just initialized is "EditView". The added lines are:

    if (UserIsLefty()) {
        LeftySwapByID( frm, EditMemoField, EditMemoScrollBar );

A common mistake (for me, at least) is to pass an object index where I should be passing an ID, or vice versa. If you have any trouble while testing your lefty interface, I suggest you first check whether you're using the "ByID" form of the Lefty function calls, and if so, make sure you're passing IDs rather than index numbers!

Click Here to Register
to receive update announcements
Please Register so I can gauge user interest, and keep you informed of updates or newly discovered bugs. Volume will be low, and I will not give your address to anyone. Just click the link to the left, make sure the return address in your browser is correct, and add some comments if you have any!
Last Updated: 4/20/04 . . . . . .