Announcement

Collapse
No announcement yet.

about Double click button event

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • telco
    replied
    colc just relax hahaha..

    Leave a comment:


  • colc
    replied
    kevin8
    WTF don't you understand
    Code:
    [B]You can insert [SIZE=20px][COLOR=#c0392b]non-executable[/COLOR][/SIZE] comments into your scripts[/B]
    Nothing will happen after
    Code:
    if ClickTime - lastClick < TimePrevious then
    AS YOU have COMMENTED it out so no script will run therefore the message box will not appear, if you insert some other code after the "IF Statement" then something will happen unless you again comment it out with "--" double dashes

    BY inserting -- into your script at the start of a line it will NOT EXECUTE and go to the next line which is an "end" of the if statement, then set Variables lastClick = ClickTime then end function

    DO you understand??

    Leave a comment:


  • kevin8
    replied
    Originally posted by colc View Post
    I am sorry my friend, but YOU should really start READING the manual before asking for help and saying I am only a BEGINNER!!!!!!!!

    Comments
    You can insert non-executable comments into your scripts to explain and document your code. In a script, any text after two dashes (--) on a line will be ignored. For example:

    if ClickTime - lastClick < TimePrevious then
    --Dialog.Message('haha', 'Success!') --Delete here?
    end
    Thank you for your reminder,
    I've read the help section on functions, but I don't quite understand the example above
    --Dialog.Message('haha', 'Success!')
    Cannot run after comment

    Leave a comment:


  • colc
    replied
    I am sorry my friend, but YOU should really start READING the manual before asking for help and saying I am only a BEGINNER!!!!!!!!

    Comments
    You can insert non-executable comments into your scripts to explain and document your code. In a script, any text after two dashes (--) on a line will be ignored. For example:

    if ClickTime - lastClick < TimePrevious then
    --Dialog.Message('haha', 'Success!') --Delete here?
    end

    Leave a comment:


  • kevin8
    replied
    I don't want message box in the function,

    dbl_click()
    Dialog.Message('haha', 'Success!')

    Leave a comment:


  • kevin8
    replied
    Originally posted by telco View Post
    you can put it even in the global..
    function dbl_click()
    ClickTime = DLL.CallFunction(_SystemFolder .. '\\winmm.dll', 'timeGetTime', '', DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
    if ClickTime - lastClick < TimePrevious then
    Dialog.Message('haha', 'Success!') --Delete here?
    end
    lastClick = ClickTime
    end

    Button on click

    dbl_click()

    Leave a comment:


  • telco
    replied
    you can put it even in the global..

    Leave a comment:


  • kevin8
    replied
    add these two lines of code to onpreload for each page ?
    ——————————————————
    TimePrevious = 200
    lastClick = 0

    Leave a comment:


  • telco
    replied
    its good also to add function in global so that you will just call the function on your each btn.


    TimePrevious = 200
    lastClick = 0


    function dbl_click()
    ClickTime = DLL.CallFunction(_SystemFolder .. '\\winmm.dll', 'timeGetTime', '', DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
    if ClickTime - lastClick < TimePrevious then
    Dialog.Message('haha', 'Success!')
    end
    lastClick = ClickTime
    end

    Button on click

    dbl_click()

    Leave a comment:


  • kevin8
    replied
    Originally posted by telco View Post
    try this:
    TimePrevious = 200
    lastClick = 0

    -----------------------
    ClickTime = DLL.CallFunction(_SystemFolder .. '\\winmm.dll', 'timeGetTime', '', DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
    if ClickTime - lastClick < TimePrevious then
    Dialog.Message('haha', 'Success!')
    end
    lastClick = ClickTime
    thanks telco

    TimePrevious = 300
    The effect is better

    now: My question ,
    All buttons must be inserted into the code above. Can you define the code as a function?
    I've just learned programming, and I don't know much

    Leave a comment:


  • telco
    replied
    try this:
    TimePrevious = 200
    lastClick = 0

    -----------------------
    ClickTime = DLL.CallFunction(_SystemFolder .. '\\winmm.dll', 'timeGetTime', '', DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
    if ClickTime - lastClick < TimePrevious then
    Dialog.Message('haha', 'Success!')
    end
    lastClick = ClickTime

    Leave a comment:


  • kevin8
    replied
    Each button needs to add the above code.

    Is there a more convenient way to double-click

    Leave a comment:


  • kevin8
    replied
    The problem has been solved



    on page preload you must define TimePrevious=0

    Leave a comment:


  • kevin8
    started a topic about Double click button event

    about Double click button event

    Hello everyone,

    I see a piece of code in the following post, but it can't run, prompt the following error, welcome any suggestions, thank you in advance


    Click image for larger version

Name:	drr.png
Views:	241
Size:	14.2 KB
ID:	305777


    Code:
    ClickTime = DLL.CallFunction(_SystemFolder .. '\\winmm.dll', 'timeGetTime', '', DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
    TimeSpace = ClickTime-TimePrevious
    if TimeSpace<300 then
    --if the time space between two clicks <300 millisecond, then define it as "double-click"then
    --(your action here!)
    Dialog.Message('haha', 'Success!')
    end
    TimePrevious=ClickTime
    -------on page preload,you must define TimeSpace=0
Working...
X