<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/OnDgsMouseDoubleClickDown?action=history&amp;feed=atom</id>
	<title>OnDgsMouseDoubleClickDown - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/OnDgsMouseDoubleClickDown?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnDgsMouseDoubleClickDown&amp;action=history"/>
	<updated>2026-04-05T17:39:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnDgsMouseDoubleClickDown&amp;diff=75797&amp;oldid=prev</id>
		<title>Thisdp: Created page with &quot;{{Client event}} __NOTOC__ This event will be fired when double clicking on any dgs element but detects clicking down (Mouse press).  {{Note|This event will not trigger when onDgsMouseClick is cancelled.}}  ==Parameters==  &lt;syntaxhighlight lang=&quot;lua&quot;&gt; string button, string state, int absoluteX, int absoluteY, bool isCoolingDown &lt;/syntaxhighlight&gt; *'''button''': the name of the button which will be clicked , it can be ''left'', ''right'', ''middle''. *'''state''': a s...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnDgsMouseDoubleClickDown&amp;diff=75797&amp;oldid=prev"/>
		<updated>2022-12-24T10:55:45Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Client event}} __NOTOC__ This event will be fired when double clicking on any dgs element but detects clicking down (Mouse press).  {{Note|This event will not trigger when &lt;a href=&quot;/wiki/OnDgsMouseClick&quot; title=&quot;OnDgsMouseClick&quot;&gt;onDgsMouseClick&lt;/a&gt; is cancelled.}}  ==Parameters==  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; string button, string state, int absoluteX, int absoluteY, bool isCoolingDown &amp;lt;/syntaxhighlight&amp;gt; *&amp;#039;&amp;#039;&amp;#039;button&amp;#039;&amp;#039;&amp;#039;: the name of the button which will be clicked , it can be &amp;#039;&amp;#039;left&amp;#039;&amp;#039;, &amp;#039;&amp;#039;right&amp;#039;&amp;#039;, &amp;#039;&amp;#039;middle&amp;#039;&amp;#039;. *&amp;#039;&amp;#039;&amp;#039;state&amp;#039;&amp;#039;&amp;#039;: a s...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This event will be fired when double clicking on any dgs element but detects clicking down (Mouse press).&lt;br /&gt;
&lt;br /&gt;
{{Note|This event will not trigger when [[onDgsMouseClick]] is cancelled.}}&lt;br /&gt;
&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string button, string state, int absoluteX, int absoluteY, bool isCoolingDown&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''button''': the name of the button which will be clicked , it can be ''left'', ''right'', ''middle''.&lt;br /&gt;
*'''state''': a string of mouse state. In this cause, it is always '''down'''.&lt;br /&gt;
*'''absoluteX''': the X position of the mouse cursor, in pixels, measured from the left side of the screen.&lt;br /&gt;
*'''absoluteY''': the Y position of the mouse cursor, in pixels, measured from the top of the screen.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the DGS element that was double clicked.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates an edit box alongside an &amp;quot;Output!&amp;quot; button. When the button is double clicked with the left mouse button when mouse is pressed, it will output the message in the edit box into the chat box.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
DGS = exports.dgs&lt;br /&gt;
-- When client's resource starts, create the GUI&lt;br /&gt;
function initGUI( )&lt;br /&gt;
    -- Create our button&lt;br /&gt;
    btnOutput = DGS:dgsCreateButton( 0.7, 0.1, 0.2, 0.1, &amp;quot;Output!&amp;quot;, true )&lt;br /&gt;
&lt;br /&gt;
    -- And attach our button to the outputEditBox function&lt;br /&gt;
    addEventHandler ( &amp;quot;onDgsMouseDoubleClickDown&amp;quot;, btnOutput, outputEditBox )&lt;br /&gt;
&lt;br /&gt;
    -- Create an edit box and define it as &amp;quot;editBox&amp;quot;.&lt;br /&gt;
    editBox = DGS:dgsCreateEdit( 0.3, 0.1, 0.4, 0.1, &amp;quot;Type your message here!&amp;quot;, true )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource( ) ), initGUI )&lt;br /&gt;
&lt;br /&gt;
-- Setup our function to output the message to the chatbox&lt;br /&gt;
function outputEditBox ( button )&lt;br /&gt;
    if button == &amp;quot;left&amp;quot; then&lt;br /&gt;
        local text = DGS:dgsGetText( editBox )-- Get the text from the edit box&lt;br /&gt;
        outputChatBox ( text ) -- Output that text&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Clear Example===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
DGS = exports.dgs&lt;br /&gt;
&lt;br /&gt;
btnOutput = DGS:dgsCreateButton( 0.7, 0.1, 0.2, 0.1, &amp;quot;Output!&amp;quot;, true )&lt;br /&gt;
&lt;br /&gt;
function outputEditBox ( button )&lt;br /&gt;
    if button == &amp;quot;left&amp;quot; then&lt;br /&gt;
        outputChatBox ( &amp;quot;Hey bro, you clicked me, your state is &amp;quot;..state )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onDgsMouseDoubleClickDown&amp;quot;, btnOutput, outputEditBox )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===DGS events===&lt;br /&gt;
{{DGSEVENTS}}&lt;/div&gt;</summary>
		<author><name>Thisdp</name></author>
	</entry>
</feed>