D-Bug & Automation Forum
D-Bug & Automation Forum >> Coding >> Either a force relocation packer or a routine to relocate
http://d-bug.mooo.com/dbugforums/cgi-bin/yabb2/YaBB.pl?num=1334222877

Message started by Phill on 12.04.12 at 09:27:56

Title: Re: Either a force relocation packer or a routine to relocate
Post by Klapauzius on 18.04.12 at 21:37:49
This routine sets up the keyboard controler to report absolute mouse packets. It's not a check routine.

The ikbd in the ST has two ways of reporting mouse actions by the user:

- the usual 'relative' mode, which will report delta values when the mouse is being moved (for example mouse has been moved 2 pixels up, etc.). In the relative mode each mouse action will automatically trigger an interrupt by the ikbd.

and

- the 'absolute' mode which is activated in your routine. This mode will send absolute mouse coordinates, not deltas. Important: in this mode you won't get an automated report when the mouse is moved or a button is pressed.
To get the current mouse position and button status you will have to inquire the mouse state.
This is done by sending a $d byte to the ikbd, which will in turn generate an interrupt by the ikbd.

Like in the code snippet you asked about on Atari-Forum.  ;)

$9 will activate this absolute mouse mode. The next four bytes sent afterwards define coordinate range.

The $c byte + the two bytes following set up the 'scale factor'. This will define how far the mouse must be moved by the user for a increment/decrement in the absolute coordinates to occur.

The $e byte + the rest will load an initial position for the mouse.

Read all about it here:
http://d-bug.mooo.com/dbugforums/cgi-bin/yabb2/YaBB.pl?num=1280676368
 :)

D-Bug & Automation Forum » Powered by YaBB 2.6.0!
YaBB Forum Software © 2000-2024. All Rights Reserved.