delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/11/02/03:37:11

Date: Thu, 2 Nov 2000 09:47:08 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Wim Cools <w DOT cools AT chello DOT nl>
cc: djgpp AT delorie DOT com
Subject: Re: Mouse cursor in text-mode
In-Reply-To: <pCWL5.54504$ka.840331@nlnews00.chello.com>
Message-ID: <Pine.SUN.3.91.1001102094649.22693E-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 1 Nov 2000, Wim Cools wrote:

> I know that you can change the
> mouse-arrow in graphics modes and that in SVGA modes you have to draw a
> cursor by yourself but does somebody know how to change the mouse cursor in
> text mode to a little white arrow or something.

The text-mode mouse pointer can be any of the 256 characters supported
by the current font.  So what you might do is this:

   - copy the system font into a DOS buffer
   - modify one of the characters in the copied font to have the shape
     of an arrow
   - tell the mouse driver to use that character as the pointer, by
     defining appropriate screen and cursor masks passed to function
     0Ah of Int 33h

This will cause your users to lose one of the characters, so you had
better choose one that is rarely needed.

The above will not solve the problem of the mouse pointer being jumpy,
i.e. it moves in character-position increments.  If you want smooth
movement at pixel resolution, like in graphics modes, you will have to
turn off the pointer drawn by the mouse driver, and instead count the
mickeys reported by, e.g., function 0Bh of Int 33h, and draw the
pointer yourself.  To that end, you will need to usurp 4 characters
from the copied font, change them to represent a moving arrow given
the motion counters reported by the mouse driver, and put all of the 4
characters around the current mouse position.

As you see, this is a lot of trouble for such a small nicety.
However, perhaps you will find a library which already does that (I
myself don't know about such libraries).  An example of copying a font
and changing it, albeit for different purposes, can be found in the
source distribution of the DJGPP library, v2/djlsr203.zip, in the file
src/libc/pc_hw/co80/conio.h, in one of the subroutines of the function
`_set_screen_lines'.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019