FIX: LASTKEY() Returns 13 When Left Mouse Button Is Pressed

Last reviewed: October 20, 1997
Article ID: Q114191
2.50 2.50a 2.50b 2.60 | 2.00 2.50 2.50a 2.50b 2.60
WINDOWS               | MS-DOS
kbprg kbbuglist kbfixlist

The information in this article applies to:

  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a, 2.5b, 2.6

SYMPTOMS

The LASTKEY() function returns 13 when the left mouse button is pressed.

RESOLUTION

Use the ON KEY LABEL LEFTMOUSE and/or ON KEY LABEL RIGHTMOUSE commands to determine when the left or right mouse button is pressed.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in FoxPro 2.6a for MS-DOS and Windows.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Place the following code into a .PRG file called TESTLAST.PRG:

          WAIT ""
          ? LASTKEY()
    

  2. Execute the code by typing the following command in the Command window:

          DO testlast
    

While the system is waiting for input, press the left mouse button. In dBASE IV, LASTKEY() will return -100 when the left mouse button is pressed. In FoxPro, LASTKEY() will return 13 when the left mouse button is pressed.


Additional reference words: FoxDos FoxWin 2.00 2.50 2.50a 2.50b 2.60
buglist2.00
buglist2.50 buglist2.50a buglist2.50b buglist2.60 fixlist2.60a differences
KBCategory: kbprg kbbuglist kbfixlist
KBSubcategory: FxinteropDbase
Solution Type : kbfix


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.

Last reviewed: October 20, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.