CrossHairs V0.03

Cross hairs

Draws a crosshairs across the screen which follows the mouse pointer
around. Useful for checking whether objects are aligned, or for comparing
two text files line by line.

Optionally, it can be used for measuring the size of an object on the
screen, or the distance between objects, or finding the position of an

Compatability and Requirements:

Your setup needs to support a mouse!

The current version was only tested on QPC2 with SMSQ/E, but there is no
reason to believe it should not work on all QL systems, as the previous
versions did.

As it stands, however, it does require a toolkit to read the pointer. I
have used Qptr's RPTR here, but you could alter the code to use
EasyPtr's RDPT instead. Or perhaps your mouse driver came with some other
command to read the mouse movements?

It also uses SMSQ/E's SCR_XLIM and SCR_YLIM to figure out the size of the
screen, ie the full display. EasyPtr also has a command, called FLIM, that
could be used instead. If you only use one screen size, you could hardwire
that size into the code: Eg replace line 35 with:

        35 xs% = 512: ys% = 256

If you find you use it often, you could do worse that attach it to a
hotkey, if you have those available. In QDOS you need the hot_rext toolkit;
in SMSQ/E they are built in. I put mine under (ALT + ) SHIFT + CTRL X.
Insert a line, similar to the one below, at the appropriate place in your
boot file:

        122 ERT HOT_LOAD1("", util$ & 'CrossHairs_obj', 'CrossHairs')


A reminder: HIT means a click on the left mouse button, and a DO means a
click on the right button. Respective alternatives are SPACE and ENTER.
Naturally, you can also move the pointer around using the cursor keys.
Somewhat easier for fine-tuning, not least of all because one axis stays
still as you move the other.

On firing up the program you should see the crosshairs. If not, press ESC
and retry with a different colour. As it stands, only the colours 1..7 are

        EXEC CrosshaisV3_obj; 7

The default is 7; no need to put that on the command line if thats the one
you want.

Find a suitable location on the screen for a tiny display box, then:

HIT once for measuring tool  -  the display shows the distance the mouse
                                pointer is from that starting point

Press Z or z                  - zeros the measure. The display stays put

HIT again for position tool   - shows the current mouse pointer position

HIT again                     - stops numerical display

HIT again                     - starts from the beginning

DO  or ESC                    - quit

Change colour to between 1 to 7 by putting the number on the command line,
or alter and recompile the code for a more permanent selection.

April 26th 2018

pjwitte at googlemail dot c0m