Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert VB keycode to asci
Message
De
24/02/2003 13:41:36
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Convert VB keycode to asci
Divers
Thread ID:
00757107
Message ID:
00757107
Vues:
47
hi everybody

i am using the MSComCtlLib.TreeCtrl.2 on a form which is trapping keys in the KeyPress event. When the activeX has the focus however, the form does not proccess the key events. so i am forwarding the KeyUp event from the tree object to the forms KeyPress event - works good.
BUT, i am not getting asci codes, rather VbKey Codes. Well, i found out how to translate letters and numbers - no problem, but all the other keys like "-" or "!" i have no clue how to change those.
here is the conversion i came up with so far:
*** ActiveX Control Event ***
LPARAMETERS keycode, SHIFT
LOCAL ;
   NewKeyKode

DO CASE
   CASE BETWEEN(keycode, 65, 90)
      * *** letters
      IF SHIFT = 0
         * *** lower case
         NewKeyKode = ASC(LOWER(CHR(keycode)))
      ELSE
         * *** upper case
         NewKeyKode = ASC(UPPER(CHR(keycode)))
      ENDIF
   CASE BETWEEN(keycode, 48, 57)
      * *** numbers
      NewKeyKode = keycode
   *CASE BETWEEN(keycode, ?, ?)
      * *** sings and other
ENDCASE
ThisForm.KeyPress(NewKeyKode, SHIFT)
Maybe i am going about it the wrong way. Any suggestions? Thanks in advance!
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform