PEN Function Returns Mouse Cursor Position in Basic (32725)
The information in this article applies to:
- Microsoft QuickBASIC 4.0
- Microsoft QuickBASIC 4.0b
- Microsoft QuickBASIC 4.5
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
- Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
This article was previously published under Q32725 SUMMARY
If the Microsoft MOUSE.SYS driver is installed, the PEN function gives
the Microsoft Mouse cursor position in both character (row and column)
and graphics (pixel) coordinates. The following values for PEN are
meaningful when using the mouse, but only if both buttons are pressed:
PEN(4), PEN(5), PEN(8) and PEN(9)
You need to test if PEN(3) equals -1 to verify that both buttons are
pushed.
Pages 314 and 315 of the "Microsoft QuickBasic 4.0: Basic Language
Reference" manual for Versions 4.00 and 4.00b describe the values
returned by the PEN function when using the mouse.
| Modification Type: | Minor | Last Reviewed: | 1/8/2003 |
|---|
| Keywords: | KB32725 |
|---|
|