At 07:13 AM 6/27/2005, you wrote:
Hi,
I have a field whose contents need to be all capital letters. A long time
ago, I wrote this code to do it:
case keyDownEvent:
if (FrmGetFocus(frm) == FrmGetObjectIndex(frm, capsfield))
event->data.keyDown.chr = upper_char(event->data.keyDown.chr);
break;
I then return false from the handler, and this code has worked correctly
for years. I just tried it, and it still works in the Emulator, through OS
4. But in the simulator, it no longer works. Stepping through the code, if
I enter a lowercase 'a', I see the call to upper_char changes the value in
event->data.keyDown.chr from 97 to 65, which is correct for a captial 'A'.
However, it's still a lowercase 'a' that is actually getting inserted into
the text field. This happens in the Treo 650, T3, and Sony OS 5
simulators, and an OS 5 device.
Anybody know what's going on here? Why does this approach no longer work?
What do I need to change to make it work in OS 5?
Rather than change the event data, you need to absorb the event and post a
new one. On Palm OS 5, the event structure you get in your 68K code is a
shadow structure, and changes to it won't be seen by the OS code which is
using the original little-endian and ARM aligned version of the event.
-- Ben Combee, Senior Software Engineer, palmOne, Inc.
"Combee on Palm OS" weblog: http://palmos.combee.net/
Developer Forum Archives: http://news.palmos.com/read/all_forums/
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/