Greetings,

In POSE (3.5) I am able to mask the characters typed into a password field by intercepting the character on keyDownEvent and converting it to a '*' before returning false and letting the system draw the character. Here's the code:

case keyDownEvent:
fieldPtr = FrmGetObjectPtr(frmP,FrmGetObjectIndex(frmP, LoginPasswordField));
if (FrmGetObjectIndex(frmP, LoginPasswordField) == FrmGetFocus(frmP)) {
inChar = eventP->data.keyDown.chr;
if (isalnum(inChar)) {
pwdIndex = FldGetInsPtPosition(fieldPtr);
gPassword[pwdIndex] = inChar;
if (gPswdMasked) {
eventP->data.keyDown.chr = '*';
}
} else if (inChar == '\b') { // handle backspace
pwdIndex = FldGetInsPtPosition(fieldPtr);
gPassword[--pwdIndex] = '\0';
}
}
handled = false;
break;


This works correctly in POSE but when I run it on my Tungsten|E it behaves as if gPswdMasked is always false.

gPswdMasked is set and unset via a checkbox. The value is stored in application preferences. I believe the value is correct because I see the checkbox checked or unchecked correctly and persistently through app start/stop.

At this point I'm at a loss as to why the differing behaviour. Any thoughts?

Thanks for your time,

Dana


-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to