Announcement
Collapse
No announcement yet.
about Double click button event
Collapse
X
-
kevin8
WTF don't you understand
Code:[B]You can insert [SIZE=20px][COLOR=#c0392b]non-executable[/COLOR][/SIZE] comments into your scripts[/B]
Code:if ClickTime - lastClick < TimePrevious then
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:
-
Originally posted by colc View PostI 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
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:
-
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:
-
I don't want message box in the function,
dbl_click()
Dialog.Message('haha', 'Success!')
Leave a comment:
-
Originally posted by telco View Postyou can put it even in the global..
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:
-
add these two lines of code to onpreload for each page ?
——————————————————
TimePrevious = 200
lastClick = 0
Leave a comment:
-
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:
-
Originally posted by telco View Posttry 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
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:
-
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:
-
Each button needs to add the above code.
Is there a more convenient way to double-click
Leave a comment:
-
The problem has been solved
on page preload you must define TimePrevious=0
Leave a comment:
-
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
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
Tags: None
Leave a comment: