TGC Codebase Backup



Make double click with left mouse in Dark Basic by etereo

31st Aug 2007 6:27
Summary

Make double click with left mouse in Dark Basic. You can adjust funtion time values as you like to adapt your program.



Description



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    `make double click with left mouse in Dark Basic
do

click=double_click()
if click<2 then print "Not double click!!! = "; click : wait 100
if click=>2 then print "Double click!!! = "; click: wait 100

loop
end

function double_click()
oldTime=timer() :click=0
While timer()<oldTime + 800
if mouseclick()=1 then click=click+1: wait 100
if click=>2 then exitfunction click
endwhile
if click<2 then click=0
endfunction click