I'm trying to work out how to do this... I have some code that allows me to use the UpDown control to change values by 0.1 increments. It's pretty simple but it works. I'm now trying to add functionality to jump by larger values if the user is holding shift.
Here's the code that allows me to do the updown by 0.1:
Code: Select all
Gui, add, edit, w100 vTest_Variable
Gui, add, updown, vTest_Variable_UD gTest_Action_UD
Gui, Show
return
Test_Action_UD:
Gui, Submit, NoHide
Test_Control := StrReplace(A_GuiControl, "_UD")
decVal := (%Test_Control% / 10)
GuiControl,, % Test_Control, % Format("{1:0.1f}", decVal)
return
These adjustments will make it work for the FIRST "up" press, i.e. it will change from 0.2 to 1.2, but then even if holding shift, it will just continue to 1.3, 1.4, etc. then when I stop holding shift, it will jump back down to 0.5.
I know it's probably something simple, I just can't seem to figure out the logic! Please help... I've been stuck on this for hours!
[Mod action: Topic moved from "Ask for Help (v2)" since this is v1 code.]