Blanking the mouse pointer

Jon H. LaBadie jon at jonlab.UUCP
Sun Aug 7 17:52:58 AEST 1988


There has been considerable discussion concerning turning off the
mouse arrow.  I just wrote a very short program and am now working in
my normal 24 X 80 unix window with NO arrow.  I have no interest in
persuing this further, but perhaps interested parties will be able to
follow up on my idea.  The program first, then further comment.

	#include <sys/window.h>
	#include <sys/font.h>

	#define STDOUT 1

	struct umdata um;
	struct icon ic;

	main()
	{
		um.um_flags = MSICON;
		um.um_icon  = ⁣

		ioctl(STDOUT, WIOCSETMOUSE, &um);
	}

The WIOCSETMOUSE command to ioctl(2) allows one to specify a
different icon is to be used whenever the mouse is moved into a
specific rectangle within the specified window.  Except for the
two assignments, all members of the two structures are null due
to the external declarations.  I am not certain this is the most
robust thing to do, but it worked :-).

After executing the above program, the mouse arrow disappears in
the current window.  If I move the mouse to the status line, the
bottom 4 lines, or into another window, the arrow returns.  That
is until the mouse moves back into the window in which I executed
the program.

Thus, the above script is only a partial solution to the original
request.  However, I have a possible approach that might work.
Run a loop, opening each window on the system (/dev/w? and /dev/w??).
Issue the above ioctl call for the window descriptor returned from
the open(2).  No guarentees that upon close of the window, the arrow
might not return, but it is worth a shot.  May also require root
access for the unassigned windows.

Good luck,
Jon LaBadie
{att, ulysses, princeton, bcr}!jonlab!jon
-- 
Jon LaBadie
{att, ulysses, princeton}!jonlab!jon



More information about the Unix-pc.general mailing list