[comp.sys.atari.st] resetting the mouse position

rosenkra@hall.cray.com (Bill Rosenkranz) (06/05/89)

---
help, please!!!

i need to know how i can change the position of the mouse cursor (and
of course its internal absolute coord).

i tried something like:

	hide_mouse ();
	Bconout (4, 0x0E);		/* ikbd command (set abs pos) */
	Bconout (4, 0x00);		/* filler */
	Bconout (4, newx_MSB);		/* new coord */
	Bconout (4, newx_LSB);
	Bconout (4, newy_MSB);
	Bconout (4, newy_LSB);
	show_mouse ();

to no avail. the coord are pixel coord, 0,0 in UL (i have left the ikbd
in the state it was booted at, and i invoked the gem program from gulam...
i hope my "obedient servent" is not biting again). or is there something
silly like the arg to Bconout is an int and the command/data packet needs
to be char? ir do i have to call the ikbdwc() function burried in the
bios somewhere? or do i have to set up some sort of interupt handler?
btw: does the ikbd send anything back after this call (i mean other than
"normal" mouse/key/joystick/inquiry packets)?

i guess the more general question is: how do you send data to the ikbd?
the commands themselves are easy, the Bconout works for a 1 byte command.
i know how to get data from an inquiry command (using a service routine
installed on the keyboard vector, say to read joysticks). i tried
this with a mega4 (TOS 1.2).

there is an illegal way of doing this, but (to keep allan happy :^)
the solution MUST be legal. the program "mousdoub" does it (i think)
illegally (at least it uses the pointer-to-bios-function-tables-returned-
in-a0-on-illegal-biosfunction trick...

infinite thanx...

-bill rosenkranz
rosenkra@hall.cray.com

(pls send mail as news is rather sporadic here...)

ONM07@DMSWWU1A.BITNET ("Julian F. Reschke") (06/14/89)

Bill Rosenkranz writes:
>there is an illegal way of doing this, but (to keep allan happy :~)

(and me...)

>the solution MUST be legal. the program "mousdoub" does it (i think)
>illegally (at least it uses the pointer-to-bios-function-tables-returned-
>in-a0-on-illegal-biosfunction trick...

There is a very easy way to set the mouse position (check your
favorite AES manual...):

    int mrec[4];

    mrec[0] = 0; mrec[1] = 2;       /* Mouse-event */
    mrec[2] = 100; mrec[3] = 10;    /* x and y */
    appl_tplay(mrec,1,1000);