Introduction

Language Structure

IB Statements

File System

Comet 32 Runtime

Index

Reading the mouse

When a mouse button is been clicked, Comet places 4 bytes (binary encoded) into LUN's READ buffer. Your Internet Basic program can determine additional information by reading the contents of this buffer.

The 4 bytes are:

Byte Description
1-2 Screen coordinates where mouse was clicked
3 which button was pressed
4 the current state of the mouse buttons

See Reading the mouse pseudocode for a complete description.

Also see the Mouse demo program.

Example:

  LENGTH 4 & LOCAL DATA$
  1000 FORMAT DATA$
  .
  READ (#,1000)

The READ instruction returns 4 bytes of data (in binary form) from the input buffer.


Mouse Driver