
-----------------------------------
Prince Pwn
Tue May 10, 2011 2:06 pm

Detecting a Double Click
-----------------------------------
What is it you are trying to achieve?
Obtaining if a double click occurs


What is the problem you are having?
Cannot detect time since last click


Describe what you have tried to solve this problem
Creating a counter if button = 1 but continues counting as long as button is held. This is due to button always equalling 1 as long as button is held.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)




View.Set ("graphics;offscreenonly")
Mouse.ButtonChoose ("multibutton")

var driveArray : string := ""
for i : 'C' .. 'Z'
    if Dir.Exists (i + ':') then
        driveArray += i
    end if
end for

var N : int := length (driveArray)
var SELECTED : array 1 .. N of boolean

for i : 1 .. N
    SELECTED (i) := false
end for

var folderX := 10
var folderY := maxy - 60
var folderWidth := 50
var folderHeight := 50
var selectionRadius : int := -3

var clickTimer : boolean := false
var clickTimerCounter : int := 0

var mouseX, mouseY, button, left, middle, right : int
Mouse.Where (mouseX, mouseY, button)


var font := Font.New ("Serif:40")
loop

    Mouse.Where (mouseX, mouseY, button)

    for i : 0 .. N - 1
        Draw.Box (folderX + (i * folderWidth), folderY, folderX + folderWidth + (i * folderWidth), folderY + folderHeight, black)
        if mouseX >= folderX + (i * folderWidth) and mouseX = folderY and mouseY 