Input

getDragData

function getDragData()

Retrieves the data on the current drag and drop operation.

Return values

(dragdata)
A reference to a dragdata object, or nil if no drag is underway

getMouseButtonState

function getMouseButtonState(button)

Get the state of the specified mouse button.

Parameters

button   (number)   
This value specifies the mouse button whose state is being queried and should be 1 for the left mouse button, 2 for the middle button and 3 for the right button

Return values

(boolean)
Returns true if the button is pressed and false if it is not

getMousePosition

function getMousePosition()

Retrieve the current mouse pointer coordinates relative to the top left corner of the application window area.

Return values

(number)
The X coordinate of the mouse cursor(number)
The Y coordinate of the mouse cursor

isAltPressed

Check the state of the alt key.

Return values

(boolean)
Returns true if the key is down, false otherwise

isControlPressed

Check the state of the control key.

Return values

(boolean)
Returns true if the key is down, false otherwise

isShiftPressed

Check the state of the shift key.

Return values

(boolean)
Returns true if the key is down, false otherwise

onAlt

Called when the alt key is pressed down or released.

Parameters

pressed   (boolean)   
A value of true if the key was pressed, or false if it was released

onControl

Called when the control key is pressed down or released.

Parameters

pressed   (boolean)   
A value of true if the key was pressed, or false if it was released

onShift

Called when the shift key is pressed down or released.

Parameters

pressed   (boolean)   
A value of true if the key was pressed, or false if it was released