To help support the answer I pase here the code that I wrote,
case fldEnterEvent:
currentField = eventP->data.ctlSelect.controlID;
break;
case keyDownEvent:
if(currentField == LoginPasswordField)
{
char *ptrP;
FieldPtr *fldPtr;
frmP=FrmGetActiveForm();
fldPtr=FrmGetObjectPtr(frmP,FrmGetObjectIndex(frmP,LoginPasswordField));
if(eventP->data.keyDown.chr == 8)
{
if(pwdIndex)
pwdIndex --;
pwdString[pwdIndex] = '\0';
}
else
{
pwdString[pwdIndex] = eventP->data.keyDown.chr;
pwdIndex ++;
pwdString[pwdIndex] = '\0';
}
ptrH = FldGetTextHandle((FieldType*)fldPtr);
if(!ptrH)
{
ptrH = MemHandleNew(sizeof(char) * agPasswordSize);
}
if(ptrH)
{
FieldType * field;
ptrP = MemHandleLock(ptrH);
if(ptrP)
{
int len;
len = StrLen(pwdString);
if(!len)
{
pwdString[0] = '\0';
pwdIndex = 0;
}
ptrP[len] = '\0';
while(len)
{
len --;
ptrP[len] = '*';
}
}
MemHandleUnlock(ptrH);
FldSetTextHandle((FieldType*)GetObjectPtr(LoginPasswordField),ptrH);
field = (FieldType*)GetObjectPtr(LoginPasswordField);
ptrH = NULL;
if (field)
FldDrawField(field);
}
handled = true;
break;
}
----------------------------------------------
Manpreet Singh wrote:
> Hello,
> One of my programs (palm os 5.x) require a password field in
> login form that display an astric (*) character like the normal password
> fields, when the user type in the password. Since there is no password
field
> with an astric support on palm, I created this field manually, and
replaced
> the normal characters with astrics and picket up the normal characters in
a
> temporary buffer. The code workd fine untill the user tries to use the
> Virtual Keyboard. The virtual keyboard seams to paste the text in the
field
> handle, bypassing my logic where I handle it character by character.
> How do I interface the virtual keyboard and the text field. which event
> should I capture so that I can pick up the text transfered by the virtual
> keyboard before it reaches the field or at least replace it with astrics,
> before the user sees the text.
>
> Thanks,
> Manpreet Singh
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/