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

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:

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

Last Reviewed: October 20, 1997