💾 Archived View for cugi.ie › aminet › 1676081127.gmi captured on 2023-03-20 at 18:35:26. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

Check if mouse buttons are pressed

   Author:       marco at markreds.it (Mark Reds)
   Uploader:     Mark Reds <marco markreds it>
   Type:         util/batch
   Architecture: m68k-amigaos
   Date:         2023-02-10
   Readme:       http://aminet.net/util/batch/MousePressed.readme
   Downloads:    6

http://aminet.net/util/batch/MousePressed.lha

This tool checks if at least one button of the given list is pressed

and delivers an appropriate return code, which can be processed in shell

scripts to trigger any action you like.

"MousePressed" doesn't require Intuition and get the mouse state by

reading CIA registers.

Just copy "MousePressed" into your C: directory or elsewehere in

your command path and use it in you scripts as the following example:

MousePressed BOTH

IF WARN

; Both LEFT and RIGHT buttons is pressed. Execute

; alternate startup-sequence number 2.

Execute S:startup-sequence.2

EndCLI >NIL:

Quit

ENDIF

;...

MousePressed LEFT

IF WARN

; MousePressed reports that the LEFT button is pressed.

; Execute alternate startup-sequence number 3.

Execute S:startup-sequence.3

EndCLI >NIL:

Quit

ENDIF

;...

Usage: MousePressed LEFT|RIGHT|BOTH|MIDDLE

LEFT check if LEFT button is pressed

RIGHT check if RIGHT button is pressed

BOTH check if both LEFT and RIGHT buttons are pressed

MIDDLE check if MIDDLE button (if your mouse has one) is pressed

"MousePressed" will return the code 5 (RETURN_WARN) if at least one of the

specified buttons are pressed, otherwise 0 (RETURN_OK) is returned.

"MousePressed" can also detects the MIDDLE button if your non-stardard

Amiga mouse is equipped with a third button, also called MIDDLE button.

Contents of util/batch/MousePressed.lha

PERMISSION  UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP     NAME
---------- ----------- ------- ------- ------ ---------- ------------ ----------
[unknown]                 3058    4392  69.6% -lh5- 5122 Feb  8 23:05 MousePressed.info
[unknown]                 1594    2220  71.8% -lh5- 31a6 Feb  8 23:05 MousePressed/MousePressed
[unknown]                 1157    2603  44.4% -lh5- 79cd Feb  8 23:05 MousePressed/Readme
[unknown]                 1935    3817  50.7% -lh5- c882 Feb  8 23:05 MousePressed/Readme.info
---------- ----------- ------- ------- ------ ---------- ------------ ----------
 Total         4 files    7744   13032  59.4%            Feb 11 02:05

Aminet © 1992-2023 Urban Müller and the Aminet team. Aminet contact address: <aminet aminet net>