Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Keypress event madness...
Message
De
08/10/2003 09:37:31
Eric Sedlacek
TTSS Interactive Products
Rockville, Maryland, États-Unis
 
 
À
07/10/2003 17:54:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00835939
Message ID:
00836182
Vues:
14
Interestingly enough, this only works for me if it goes in the class keypress event. I was doing it in a base class object before. That didn't work. A definite oddity. But I now have a working solution, and that's what counts.

Thanks,
Eric

>Hmmmm, indeed. Worked fine for me. VFP8
>
>>That certainly makes sense, but it doesn't appear to make any difference. It still doesn't work. DODEFAULT in KeyPress just doesn't seem to make the character given in the parameter appear in the Textbox.
>>
>>Hmmmmm....
>>
>>>You need to pass the parameters on through the DODEFAULT
>>>(see below)
>>>>This seems simple enough. I want to use the KeyPress event in a text box to remap keys as they are typed. Below is a bit of sample code. Of course, it doesn't work...if it did, I wouldn't be issuing this plaintive plea for help. The example below is trying to map a lower case 'a' into a lower case 'b' and a lower case 'd' into a lower case 'e'. What it actually does is do nothing when 'a' or 'd' are pressed and behaves normally otherwise. How do I do this correctly?
>>>>
>>>
>>>LPARAMETERS nKeyCode, nShiftAltCtrl
>>>lnBefore=nKeyCode
>>>DO CASE
>>>     CASE lnBefore=97
>>>          lnAfter=98
>>>     CASE lnBefore=100
>>>          lnAfter=101
>>>     OTHERWISE
>>>          lnAfter=lnBefore
>>>ENDCASE
>>>IF lnBefore<>lnAfter
>>>     NODEFAULT
>>>     nKeyCode=lnAfter
>>>     DODEFAULT(nKeyCode, nShiftAltCtrl)
>>>ENDIF
>>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform