OnDgsMouseDoubleClick: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Client event}} __NOTOC__ This event occurs when double clicking on any dgs-element. ==Parameters== <syntaxhighlight lang="lua"> string button, int absoluteX, int absoluteY...") |
No edit summary |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
__NOTOC__ | __NOTOC__ | ||
This event occurs when double clicking on any dgs-element. | This event occurs when double clicking on any dgs-element. | ||
{{Note|This event will not trigger when [[onDgsMouseClick]] is cancelled.}} | |||
==Parameters== | ==Parameters== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
string button, int absoluteX, int absoluteY | string button, string state, int absoluteX, int absoluteY | ||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''button:''' | *'''button:''' The name of the button which will be clicked , it can be ''left'', ''right'', ''middle'' | ||
*'''absoluteX:''' | *'''state:''' The state of the mouse button. Can be ''down'' or ''up''. ( Please note that '''both''' ''up'' and ''down'' state are supported! ) | ||
*'''absoluteY:''' | *'''absoluteX:''' The X position of the mouse cursor, in pixels, measured from the left side of the screen. | ||
*'''absoluteY:''' The Y position of the mouse cursor, in pixels, measured from the top of the screen. | |||
==Source== | ==Source== | ||
Line 19: | Line 21: | ||
DGS = exports.dgs | DGS = exports.dgs | ||
button = DGS: | button = DGS:dgsCreateButton(0.3, 0.3, 0.1, 0.05, "Button", true) | ||
addEventHandler( " | addEventHandler( "onDgsMouseDoubleClick", button, | ||
function(button, x, y) | function(button, state, x, y) | ||
if button == 'left' then | if button == 'left' and state == 'up' then | ||
outputChatBox("This is a test button clicked on X: " .. x .. " Y: " .. y) | outputChatBox("This is a test button clicked on X: " .. x .. " Y: " .. y) | ||
end | end |
Latest revision as of 11:48, 12 February 2021
This event occurs when double clicking on any dgs-element.
Parameters
string button, string state, int absoluteX, int absoluteY
- button: The name of the button which will be clicked , it can be left, right, middle
- state: The state of the mouse button. Can be down or up. ( Please note that both up and down state are supported! )
- absoluteX: The X position of the mouse cursor, in pixels, measured from the left side of the screen.
- absoluteY: The Y position of the mouse cursor, in pixels, measured from the top of the screen.
Source
The source of this event is the DGS element that was double clicked.
Example
This example creates a text button and clicking on it will tell you the position coordinates of the mouse cursor:
DGS = exports.dgs button = DGS:dgsCreateButton(0.3, 0.3, 0.1, 0.05, "Button", true) addEventHandler( "onDgsMouseDoubleClick", button, function(button, state, x, y) if button == 'left' and state == 'up' then outputChatBox("This is a test button clicked on X: " .. x .. " Y: " .. y) end end )
See Also
DGS events
General
- onDgsBlur
- onDgsCreate
- onDgsCursorTypeChange
- onDgsCursorStateChange
- onDgsDestroy
- onDgsElementRender
- onDgsElementMove
- onDgsElementSize
- onDgsElementEnter
- onDgsElementLeave
- onDgsFocus
- onDgsKey
- onDgsPositionChange
- onDgsPreRender
- onDgsRender
- onDgsElementScroll
- onDgsSizeChange
- onDgsTextChange
- onDgsWindowClose
- onDgsPropertyChange
Check Box
Combo Box
Drag'N Drop
Edit
Grid List
Menu
Selector
Mouse
- onDgsMousePreClick
- onDgsMouseClick
- onDgsMouseClickDown
- onDgsMouseClickUp
- onDgsMouseDrag
- onDgsMouseDoubleClick
- onDgsMouseDoubleClickDown
- onDgsMouseDoubleClickUp
- onDgsMouseDown
- onDgsMouseHover
- onDgsMouseEnter
- onDgsMouseLeave
- onDgsMouseMultiClick
- onDgsMouseMove
- onDgsMouseStay
- onDgsMouseUp
- onDgsMouseWheel
Radio Button
Switch Button
Tab
Animation
Plugin
Media
- onDgsMediaPlay
- onDgsMediaPause
- onDgsMediaStop
- onDgsMediaLoaded
- onDgsMediaTimeUpdate
- onDgsMediaBrowserReturn
Color Picker
QRCode
Remote Image
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled