Skip to content

brexxlib

A tape is a Blitz object, numbered from 0, that holds a sequence of mouse and keyboard events. Record records what the user does with the mouse and the keyboard onto a tape, and PlayBack plays it back later, as if the user did it again, into any program on the system. SaveTape and LoadTape keep tapes in files, and MacroKey lets a key start a tape.

The program can also make events itself: AbsMouse and RelMouse move the mouse pointer, MouseButton and ClickButton press the buttons and Type types a text. After TapeTrap Tape#, these commands go onto the tape instead, which makes tapes without recording; with QuietTrap On they only go onto the tape and do nothing else.

Record 0
VWait 250 ; five seconds of input on a PAL Amiga
Record
PlayBack 0
Repeat : VWait : Until XStatus=0

The commands that make events can also be used while a tape records or plays back; the recording or playback goes on.

Based on the brexxlib guide by Acid Software.

Library number 132. It manages Tape objects, by default at most 5 (the compiler options set the maximum).

Commands

AbsMouse

Moves the mouse pointer to X,Y of the display.

Statement. Help text: X,Y
Arguments: .w, .w

ClickButton

Presses and releases a mouse button, 0 the left and 1 the right one, as two MouseButton commands do; for example to select a gadget.

Statement. Help text: Button : 0=Left
Arguments: .w

FreeMacroKey

Removes the tape from the key Rawkey with the qualifier keys Qualifier again.

Statement. Help text: Rawkey,Qualifier
Arguments: .w, .w

LoadTape

Loads a tape saved with SaveTape.

Statement. Help text: Tape#,filename$
Arguments: .w, $

A file that cannot be opened is the error “Can’t Open File”. A file shorter than the 8 bytes of the start time gives an empty tape. A tape file has no mark of its kind, so any other file of 8 bytes or more loads as a tape; an incomplete event at its end ends the load without an error.

MacroKey

Makes the key with the raw key code Rawkey, pressed with the qualifier keys Qualifier, play back the tape.

Statement. Help text: Tape#,Rawkey,Qualifier
Arguments: .w, .w, .w

MouseButton

Presses (On) or releases (Off) a mouse button, 0 the left and 1 the right one.

Statement. Help text: Button,On|Off : 0=Left
Arguments: .w, .w

PlayBack

Starts playing back the tape, as if the user moved the mouse and typed again; without a tape, stops the playback.

Statement. Help text: [Tape#]
2 forms:

  • no arguments
  • .w

PlayWait

Waits until the running playback has finished; it returns at once if no playback runs.

Statement. Help text: [Tape#]
2 forms:

  • no arguments
  • .w

With Tape#, it plays Tape# in place of a running playback and waits until that has finished; it also returns at once if the tape is empty. The form without Tape# is the port’s: the original refused it with “Syntax Error”. A source that must also compile with the original waits with Repeat : VWait : Until XStatus=0.

QuickPlay

On plays tapes back without the pauses between the events. Off, the start value, keeps the pauses; a tape needs them when a program on it must wait, for example for the disk.

Statement. Help text: On|Off
Arguments: .w

QuietTrap

With On, the start value, the commands caught by TapeTrap only go onto the tape; with Off, they also take effect.

Statement. Help text: On|Off
Arguments: .w

Record

Starts recording all mouse and keyboard input onto the tape; without a tape, stops the recording.

Statement. Help text: [Tape#]
2 forms:

  • no arguments
  • .w

RelMouse

Moves the mouse pointer by X Offset,Y Offset from where it is; positive values move it right and down.

Statement. Help text: X Offset,Y Offset
Arguments: .w, .w

SaveTape

Saves a tape into a file, for LoadTape.

Statement. Help text: Tape#,Filename$
Arguments: .w, $

Tape

The object of a tape of mouse and keyboard events, as the introduction describes.

Object name. Help text: A BREXX Macro

TapeTrap

Makes the following AbsMouse, RelMouse, MouseButton, ClickButton and Type commands go onto the tape; without a tape, it ends that.

Statement. Help text: [Tape#]
2 forms:

  • no arguments
  • .w

Type

Types the characters of String$, as if they came from the keyboard; they normally go to the active window. A character that has no key is skipped.

Statement. Help text: String$
Arguments: $

XStatus

What the library is doing, 0 nothing, 1 recording and 2 playing back.

Function, result .l. No help text.
No arguments.