Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
KeyPress bug?
Message
De
04/04/2002 10:00:23
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
KeyPress bug?
Divers
Thread ID:
00640867
Message ID:
00640867
Vues:
63
In VFP7, the F2 key doesn't trigger the KeyPress event. This used to work correctly under VFP6 but in VFP7 the key is ignored. I suspect it has to do with the new key assignements in VFP7 where the F2 key is used to move to the next bookmark and to rename a file in the project manager. I would appreciate if someone could confirm this behaviour. To reproduce the problem, simply run the code below. Pressing the F2 key triggers the WAIT WINDOW in VFP6, but the key is ignored in VFP7.

Thanks for any feedback.
o = CREATEOBJECT("TestForm")
o.show()

DEFINE CLASS TestForm AS FORM
   
   caption = "Press any key..."
   height = 70
   width = 290
   autocenter = .T.
   WindowType = 1
   KeyPreview = .T.

   ADD OBJECT cmdCancel AS cmdCancel

   PROCEDURE Init
      PUSH KEY CLEAR
   ENDPROC

   PROCEDURE Destroy
      POP KEY
   ENDPROC
   
   PROCEDURE KeyPress(nKeyCode, nShiftAltCtrl)

      WAIT WINDOW TIMEOUT 1 "Form.KeyPress()" + CHR(13)+;
                            "nKeyCode = " + ALLTRIM(STR(nKeyCode)) + CHR(13) + ;
                            "nShiftAltCtrl = " + ALLTRIM(STR(nShiftAltCtrl))

   ENDPROC

ENDDEFINE

DEFINE CLASS cmdCancel as COMMANDBUTTON
   autosize = .T.
   caption = "Cancel"
   cancel = .T.
   height = 27
   left = 220
   top = 40
   width = 58
   PROCEDURE click
      thisform.release
   ENDPROC
ENDDEFINE
Daniel
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform