Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
KeyPress bug?
Message
From
04/04/2002 10:00:23
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
KeyPress bug?
Miscellaneous
Thread ID:
00640867
Message ID:
00640867
Views:
62
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
Next
Reply
Map
View

Click here to load this message in the networking platform