Posted: Sat Jan 27, 2024 2:22 am Post subject: Holding Buttons?
So my senario is i have a button that increase the value 0.10 of address for every click but i want to do is keep increasing the value when i hold the button. Can someone teach me how to do it. Thanks
f1 = createForm() -- your form (UDF1 or myTrainer etc.)
b1 = createButton(f1) -- your button name? (UDF1.CEButton1 etc.)
b1.Top=80 b1.Left=80 b1.Height=35 b1.Width=130
b1.Caption = "MouseDown Start"
lastIndex=1
function checkKeys(timer)
if isKeyPressed(VK_LBUTTON) then
-- Put your code here that increases the value by "0.10".
-- (Must be between if..else. Not between else..end.)
lastIndex=tonumber(lastIndex) + 1
print(lastIndex)
else
lastIndex=1
timer.Enabled = false
end
end
if downTmr1 then downTmr1.destroy() downTmr1=nil end
f1 = createForm() -- your form (UDF1 or myTrainer etc.)
b1 = createButton(f1) -- your button name? (UDF1.CEButton1 etc.)
b1.Top=80 b1.Left=80 b1.Height=35 b1.Width=130
b1.Caption = "MouseDown Start"
lastIndex=1
function checkKeys(timer)
if isKeyPressed(VK_LBUTTON) then
-- Put your code here that increases the value by "0.10".
-- (Must be between if..else. Not between else..end.)
lastIndex=tonumber(lastIndex) + 1
print(lastIndex)
else
lastIndex=1
timer.Enabled = false
end
end
if downTmr1 then downTmr1.destroy() downTmr1=nil end
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum