Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
KeyPress/KeyPreview: Inconsistencies and Contradictions
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
KeyPress/KeyPreview: Inconsistencies and Contradictions
Miscellaneous
Thread ID:
00141700
Message ID:
00141700
Views:
81
The following is a bug report I've submitted to MS:

I've discovered several issues concerning the KeyPress event and KeyPreview property and/or it's documentation.

First, let's start with the help file. The entry for KeyPress states: "The KeyPress event does not occur for any combination of keys with the ALT key". However, when you edit the KeyPress Event, you'll notice that there are 2 parameters; nKeyCode and nShiftAltCtrl. Note that the second parameter's name implies that you CAN preview Alt key combinations. The same implication is made in the Support Online pages. If you look at the table of key combination values in article Q140296, you'll notice the values listed for Alt-Function key combinations.

There are also undocumented exceptions to the KeyPress and KeyPreview. For example, you can not preview a key that has been defined as a menu shortcut. Shortcut menu items with shortcut keys define seem inconsistent in behavior. As a test, I defined a popup menu that defined Ctrl-T, Ctrl-F12, and Ctrl-F11 as shortcut keys. The results were that the popup key took precedence over the Ctrl-T, and Ctrl-F12 keystrokes, while the Ctrl-F11 was passed to the KeyPress event.

These are only the inconsistencies, and contradictory information I have found in my tests. It seems likely there are others pertaining to this issue.
kenweber
GCom2 Solutions
Microsoft Certified Professional

Reply
Map
View

Click here to load this message in the networking platform