mouseDown

Typemessage
DictionaryLCS
LibraryLiveCode Script
Syntax
mouseDown <pButtonNumber>
Associationsstack, card, field, button, graphic, scrollbar, player, image
Summary

Sent when the user presses the mouse button.

Introduced1.0
OSmac, windows, linux, ios, android, web
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
pButtonNumber

Specifies which mouse button was pressed:

"1": the left button on systems with a multi-button mouse and the mouse button on Mac OS systems with a single-button mouse.
"2": the middle button on systems with a three-button mouse.
"3": the right button on systems with a multi-button mouse and Control-click on Mac OS systems with a single-button mouse.
Example
# show popup menu on Right-click/Control-click (Mac OS)
#  assumes presence of a popup-style menu button, "Configure"
on mouseDown theButton 
  if theButton is 3 then 
    popup button "Configure"
  else 
    pass mouseDown
  end if
end mouseDown
# To let the user click and drag an object
#  put this handler in the object's script
on mouseDown
  grab me
end mouseDown
RelatedKeyword: control
Property: repeatDelay
Message: scrollbarBeginning, scrollbarLineInc, mouseDown, mouseStillDown
Command: grab
Function: mouseClick
Glossary: field, pixel, mouse button, lock, message, card, mouse pointer, image, object
Description

Handle the mouseDown message to perform an action when the user presses the mouse button, before the mouse button is released.

The mouseDown message is sent to the control that was clicked, or to the card if no control was under the mouse pointer.

If the Browse tool is being used, and you click an unlocked field with mouse button 1 or 2, no mouseDown message is sent. If you click with mouse button 3, the mouseDown message is sent even though the field is not locked.

Note: If the user clicks a transparent pixel in an image, the mouseDown message is sent to the object behind the image, not to the image.

Tagsui