Vesselin Bontchev wrote:
Hello folks,
I would like to make my application react to the user pressing the middle button of the 5-way control on Tungsten E - more specifically, I want when this button is pressed, the effect to be the same as when the user taps on the default button on the form.
So far I have found the following:
1) For this to work, the form must have a default button assigned to it (of course).
2) The form must be a modal form.
If the above is true, no particular code is required from the application - pressing the middle button of the 5-way control simulates tapping on the default button. There is one exception, though - it doesn't work for the main form, even if it is made a modal form.
My questions are:
How do I make this work on any kind of form - modeless forms and/or the main form? Is there some particular attribute that I must take care to set for the form? Or do I have to handle the pressing of this button in my application and react accordingly?
If the latter - how do I do that? The Knowledge Base mentions something about the "vchrRocker characters" - but I couldn't find an example of how to actually use them. What kind of event type do I get when this button is pressed and how do I check for it? I tried
switch (eventP->eType) { case keyDownEvent: switch (eventP->data.keyDown.chr) { case vchrHardRockerCenter: case vchrRockerCenter: FrmAlert (CenterButtonPressed); handled = true; break; default: break; } break; }
but it doesn't seem to work.
Regards, Vesselin
It's not Rocker, it's nav-codes. PalmOne used a different system for TE and T1, T2 and T3. Go to PalmOne download the 5-way-SDK and use the defines there. To simulate the button press, cath the keyDown and do the same as you would do pressing the default button.
Regards Henk
-- ------------------------------------------------------------------------- Henk Jonas [EMAIL PROTECTED] Palm OS Â certified developer
Please contact me, if you need an off-side contract worker. -------------------------------------------------------------------------
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
