DOCUMENT:Q140157 10-FEB-2000 [foxpro] TITLE :How to Right-Click by Using the Keyboard in Visual FoxPro PRODUCT :Microsoft FoxPro PROD/VER:WINDOWS:3.0 OPER/SYS: KEYWORDS: ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual FoxPro for Windows, version 3.0 ------------------------------------------------------------------------------- SUMMARY ======= There are several mouse enhancement utilities for the Windows environment that allow the right mouse button to be reassigned to another function, such as a double-click event. While enabling this feature may greatly improve productivity, it also prevents the right mouse button from invoking the context menus found throughout the Visual FoxPro user interface. Although one solution is to purchase a three button mouse and assign the double-click functionality to the middle button, you can avoid this by using the ON KEY LABEL and MOUSE commands. The following command, placed in Vfpstart.prg program or at the beginning of an application defines a specific keyboard combination to mimic a right-click in order to bring up the appropriate menu for each object. MORE INFORMATION ================ Visual FoxPro now provides the ability to perform mouse actions programmatically by using the MOUSE command. The desired action is specified by CLICK, DBLCLICK, or DRAG TO clauses while the button to press is indicated by LEFT, MIDDLE, or RIGHT clauses. In this example, the key combination of CTRL+SPACEBAR is used as a surrogate right-click, and the ON KEY LABEL command is initiated within VFPSTART so that it is available throughout the development session. Step-by-Step Example -------------------- 1. Open the Vfpstart.prg program file found in the Vfp directory. 2. Insert a new line following the #define lines, and add this line: ON KEY LABEL ctrl+spacebar MOUSE CLICK RIGHT 3. Save the program Note that the command will not take effect until VFPSTART is recompiled and run. To put the command in effect immediately, run VFPSTART or repeat the command in the Command window. Additional query words: VFoxWin redefine alternate ====================================================================== Keywords : Technology : kbVFPsearch kbAudDeveloper kbVFP300 Version : WINDOWS:3.0 ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 2000.