Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

ISMOUSE()

A function to determine whether or not a mouse is present—but it hasn’t worked since FoxPro 2.x!

Usage

lMouseHere = ISMOUSE()

It is possible to run most Windows functions using nothing but the keyboard. Some people prefer using the keyboard. Other users, particularly those in high-speed, “heads-down” data entry, find keyboard entry far faster. Still others, such as those with vision or motor limitations, may require it. Plan to develop interfaces that support full keyboard functionality, even when the underlying controls (such as switching pages on a page frame) don’t support a keyboard method natively.

We find that we tend to design interfaces similar to those we use. This is a natural tendency, and one that, in theory, is a benefit of the Macintosh and Windows GUIs. However, there are items in Visual FoxPro’s interface that are best left there, and not disseminated in our applications. Forcing users to switch from keyboard to mouse, rather than offering them the option, is the sign of a poorly designed interface. Before shipping your application, consider ripping the mouse out of the back of your machine and verifying that all the functionality is available from the keyboard.

By designing our systems to work with either interface, a test for the presence of a mouse becomes unnecessary. This is one test we don’t anticipate installing in our startup routines, but if your client has systems without mice and will pay you to program it, here’s the function to do it.

Except, of course, it doesn't work. ISMOUSE() seems to always return .T. under Visual FoxPro, whether or not the hardware is present, whether or not drivers are installed for the mouse.

Example

IF ISMOUSE()  && good, there's a mouse,...

See Also

IsColor()