Cursor Positioning in Text Mode

Last reviewed: September 16, 1996
Article ID: Q19866
The information in this article applies to:
  • Microsoft Mouse Driver for MS-DOS, versions 1.x, 2.x, 3.x, 4.x, 5.x, 6.x, 7.x, 8.x, and 9.0

SUMMARY

If you use the Microsoft Mouse in a program that runs in text mode, the mouse returns cursor position values in PELs. You can convert these to character cell values by dividing them by 8.

MORE INFORMATION

If the mouse detects that the screen is in text mode (for example, EGA or CGA), the cursor position return values from the mouse functions are returned with MOD 8 values (the lowest three bits are 0). The outputs from the relevant mouse functions may be divided by 8, or bit-shifted right by three. Conversely, character cell positions sent to the mouse should be multiplied by 8 (or bit-shifted left by 3).


KBCategory: kbhw
KBSubcategory:
Additional reference words: 7.00 7.04 7.05 8.00 8.10 8.20 9.00


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: September 16, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.