Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trapping key press events
Message
From
29/05/2007 18:02:39
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Trapping key press events
Miscellaneous
Thread ID:
01229175
Message ID:
01229175
Views:
61
I'm trying to trap keypresses that users can use to setup a simple hot key database for data entry.

So, inside my keypress event in my form textbox I use...
lparameters nKeyCode, nShiftAltCtrl
* Check for Alt key
IF nShiftAltCtrl = 4
   * Stop VFP's processing of the keystroke
   NODEFAULT
   * Provide our own processing of the keystroke
   this.value = "ALT-" + CHR(nKeyCode)
   ThisForm.txtTextbox2.SetFocus()
ENDIF
Unfortunately I've found that the keypress is completely ignores my alt key and instead just goes ahead uses the default behavior. For example, hitting alt-f pops up the file menu. Sadly the user has already memorized a ton of alt-???? key presses and I'd like a way for her to edit and manage them in a way that is easy. Any ideas how to get around this?

Greg
Next
Reply
Map
View

Click here to load this message in the networking platform