dieterhatn Posted July 26, 2014 Share Posted July 26, 2014 Hi there. I've written a Volume Control Script, which lowers the Volume of the Foreground window on hotkey. I've combined this with a Splash Popup to always see my current volume of the Window. So usually I keep holding down the Button until I reach my desired volume. But when it comes to fullscreen apps, it sometimes does not work. It lowers the volume to the desired degree, but then gets executed again and again (depending on how long I've pressed the Hotkey before). So for example when I lower the volume from 50% to 10% it still gets executed after i released the key again and repeats 40 times. Is there a way to block this behaviour? Thanks in advance Link to comment Share on other sites More sharing options...
JohnOne Posted July 26, 2014 Share Posted July 26, 2014 Show code. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
dieterhatn Posted July 26, 2014 Author Share Posted July 26, 2014 (edited) I simplified the Popup Splash, the original one is a bit more confusing because of lots of text formatting.HotKeySet("{VOLUME_DOWN}", "ADown") Func ADown() Local $Proc = Process(WinGetHandle("[ACTIVE]")), $p = GetProc($Proc), $Title = WinGetTitle("[ACTIVE]") ;Lower Volume If $Vol[$p][1] > 0 AND $Vol[$p][1] <= 50 then $Vol[$p][1] += -1 ; Change Volume in Array (Max Volume is 50%) SplashTextOn("Volume", $Title & @LF & "Volume: " & $Vol[$p][1] & "%", 250, 75, 2154, 750, 33, "Calibri", 24, 400) Off() EndFunc Func Off() Sleep(2000) SplashOff() EndFunc Edited July 26, 2014 by dieterhatn Link to comment Share on other sites More sharing options...
JohnOne Posted July 26, 2014 Share Posted July 26, 2014 Unset hot key when enter function and re set it before exit function. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Solution dieterhatn Posted July 26, 2014 Author Solution Share Posted July 26, 2014 (edited) &amp;nbsp; Unset hot key when enter function and re set it before exit function.&amp;nbsp; That won't fix the issue, cause its just a delayed execution I guess, so the key was pressed just the execution is delayed. Edit: I could just check if the key is pressed before entering the function, unfortunately I cant find the code of the VolumeUp and VolumeDown keys. Maybe anyone can help me here? Edit 2: Found it on the MSDN. "AF" is Volume Up and "AE" is Volume Down. That seems to fix the issue. Edited July 26, 2014 by dieterhatn Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now