All Databases
Inside Mac - Basic Toolbox
Button
WaitNextEvent
GetNextEvent
GetMouse
StillDown
WaitMouseUp
GetKeys
ExitToShell
Button
See if the mouse button is up or down
#include <
Events.h
>
Event Manager
Boolean
Button
(
);
returns
Is mouse button down?
Button
returns the state of the mouse button, whether it is up or down.
Returns
: a
Boolean
value identifying the state of the button. It is one of:
FALSE
button is up
TRUE
button is down
Notes: In most cases, you process mouse button actions by reading
mouseDown
and
mouseUp
events via
WaitNextEvent
.This function gives you the ability
to write, for example:
printf("Press the mouse button to end");
while ( !
Button
() ) ;
ExitToShell
();
During a drag operation, a more valid test is
StillDown
, which
determines if the mouse has been continuously pressed since the most
recent
mouseDown
event.
Note
: This does not read or affect the event queue; it simply detects
the state of the mouse button.
Referenced by (114):
Creating Offscreen Bitmaps
GetMouse
Offscreen Graphics
SeedCFill
StillDown
B Topics (MacTech Index)
L Authors (MacTech Index)
M Authors (MacTech Index)
S Topics (MacTech Index)
Vol 2 Issues (MacTech Index)
Vol 7 Issues (MacTech Index)
Button Panel (THINK Ref Viewer Help)
Going Back to Topics You've Read (THINK Ref Viewer Help)
Navigation Buttons (THINK Ref Viewer Help)
Searching (THINK Ref Viewer Help)
Speed Search (THINK Ref Viewer Help)
Using the Tables of Contents (THINK Ref Viewer Help)
small icon mode (THINK Ref Viewer Help)
May 93 - WAMADA Notes (Frameworks Archive)
November 91 - User Selected Folders & Indexing Through Directories (Frameworks Archive)
32 Bit Gray Scale Ramp Palette Example (Inside Mac - Index)
An Example INIT (Inside Mac - Index)
Custom File Dialog (Inside Mac - Index)
Getting Files Selected from the Finder (Inside Mac - Index)
Gray Scale Palette Example (Inside Mac - Index)
Gray Scale Ramp Palette Example (Inside Mac - Index)
How To Hide the MenuBar (Inside Mac - Index)
How to Display a Progress Bar (Inside Mac - Index)
Operating System Event Manager (Inside Mac - Index)
TrapWords (Inside Mac - Index)
Using FSRead to Read from a File (Inside Mac - Index)
Using the List Manager in a Modal Dialog (Inside Mac - Index)
Creating Offscreen Bitmaps (Inside Mac - Basic Toolbox)
Customizing Your Interface (Inside Mac - Basic Toolbox)
Dialog Boxes (Inside Mac - Basic Toolbox)
GetMouse (Inside Mac - Basic Toolbox)
Offscreen Graphics (Inside Mac - Basic Toolbox)
SeedCFill (Inside Mac - Basic Toolbox)
SetDAFont (Inside Mac - Basic Toolbox)
StillDown (Inside Mac - Basic Toolbox)
Arrowheads (MacTech Vol 01-1984-5)
Buttons and Edits (MacTech Vol 01-1984-5)
Disassembler (MacTech Vol 01-1984-5)
Foundation Of Quickdraw (MacTech Vol 01-1984-5)
Iteration (MacTech Vol 01-1984-5)
Button DA (MacTech Vol 02-1986)
Expert Systems (MacTech Vol 02-1986)
XModem Transfer (MacTech Vol 02-1986)
Code Tester (MacTech Vol 03-1987)
Dialog Events (MacTech Vol 03-1987)
HyperCard Programming (MacTech Vol 03-1987)
Printer Resource 2 (MacTech Vol 03-1987)
Data Conversion (MacTech Vol 04-1988)
HyperCard 1.2 (MacTech Vol 04-1988)
HyperCard Products (MacTech Vol 04-1988)
PopUp Hyper (MacTech Vol 04-1988)
Designer CDEF (MacTech Vol 05-1989)
Dialoger (MacTech Vol 05-1989)
Dot Printer (MacTech Vol 05-1989)
Gestures (MacTech Vol 05-1989)
MIDI User Interface (MacTech Vol 05-1989)
Quadratic Plotters (code) (MacTech Vol 05-1989)
Quadratic Plotters 2 (MacTech Vol 05-1989)
Scroll Bar CDEF (MacTech Vol 05-1989)
VBL Task Animation (MacTech Vol 05-1989)
Cursor Control 2 (MacTech Vol 06-1990)
Hunk Mgr, Word Sol'n (MacTech Vol 06-1990)
MacApp and C++ (MacTech Vol 06-1990)
Micro-draw (MacTech Vol 06-1990)
Serius89, Freditor (MacTech Vol 06-1990)
Serius89, HyperBASIC (MacTech Vol 06-1990)
Spiffy Color 1 (MacTech Vol 06-1990)
cdev Debugging (MacTech Vol 06-1990)
Dec 91 Mousehole (MacTech Vol 07-1991)
OOP Architectures 1 (MacTech Vol 07-1991)
Oct 91 Letters (MacTech Vol 07-1991)
Aug 92 Tips (MacTech Vol 08-1992)
C or Pascal? (MacTech Vol 08-1992)
Event Programming (MacTech Vol 08-1992)
Print Dialogs (MacTech Vol 08-1992)
Prograph 2.5 (MacTech Vol 08-1992)
Separate Data, Code (MacTech Vol 08-1992)
TextBoxer (MacTech Vol 08-1992)
Bitmapper (MacTech Vol 09-1993)
PictButton (MacTech Vol 09-1993)
Accurate Timing (MacTech Vol 10-1994)
Aug 94 Newsbits (MacTech Vol 10-1994)
Prograph Review (MacTech Vol 10-1994)
Apple Guide Intro (MacTech Vol 11-1995)
Guide Extrn Code Modules (MacTech Vol 11-1995)
Jul 95 Newsbits (MacTech Vol 11-1995)
PowerPlant (MacTech Vol 11-1995)
TCL and VA (MacTech Vol 11-1995)
TCL and VA 2 (MacTech Vol 11-1995)
Blinking Letters 2 (MacTech Vol 12-1996)
Java Components (MacTech Vol 12-1996)
Java Grids (MacTech Vol 12-1996)
Java Layouts (MacTech Vol 12-1996)
Oct 96 Tips (MacTech Vol 12-1996)
PP Modeless Child Wins (MacTech Vol 12-1996)
3D Controls in Sys 7 Apps (MacTech Vol 13-1997)
Apr 97 Top 10 (MacTech Vol 13-1997)
OpenStep Overview (MacTech Vol 13-1997)
Apr 98 - Getting Started (MacTech Vol 14-1998)
Jan 98 - Getting Started (MacTech Vol 14-1998)
Rapid Prototyping (MacTech Vol 14-1998)
Rez Is Your Friend (MacTech Vol 14-1998)
Inside InputSprocket (MacTech Vol 15-1999)
May 99 Factory Floor (MacTech Vol 15-1999)
The LayerGroup (MacTech Vol 15-1999)
Cubby VR Part II (MacTech Vol 17-2001)
May 92 - MACINTOSH Q & A (develop - 1992)
September 93 - WORKING IN THE THIRD DIMENSION (develop - 1993)
September 94 - SOMEWHERE IN QUICKTIME (develop - 1994)