EZG Posted November 19, 2018 Share Posted November 19, 2018 Hey I used to have a script for AHK to achieve this: !WheelUp::Send {Volume_Up 1} !WheelDown::Send {Volume_Down 1} But in AutoIt I can't manage to make anything work. I've tried several things without any results. I need help to achieve the same result please. Link to comment Share on other sites More sharing options...
Nine Posted November 19, 2018 Share Posted November 19, 2018 https://www.autoitscript.com/forum/topic/143464-~-is-it-possible-to-detect-the-mouse-whee-move-solved/ to check if alt down, use _ispressed () “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted November 19, 2018 Moderators Share Posted November 19, 2018 @EZG our forum has a wonderful search function. If you search "volume control" you will doubtlessly find the many many times this has been asked and answered. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
EZG Posted November 19, 2018 Author Share Posted November 19, 2018 Thanks for the suggestion but I can't seem to find any relevant information. Page 2 at the moment, will keep reading. Link to comment Share on other sites More sharing options...
EZG Posted November 20, 2018 Author Share Posted November 20, 2018 Sorry I'm probably very bad but I can't achieve what I want. It took me like 5min to figure it our in AHK in the past when I did it, it's been years that I use this script. I wanted to switch to AutoIt but I already invested so much time trying to read and learn to achieve what I want but I can't figure it out. Kinda hard to find relevant info for what I need. I give up guys lol. Good night bye. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted November 20, 2018 Moderators Share Posted November 20, 2018 Wow, giving up after less than three hours - and after someone pointed you directly to a topic that would help you - I am sure you'll do wonderful things in the scripting world FrancescoDiMuro 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Nine Posted November 20, 2018 Share Posted November 20, 2018 Good bye. Have nice dreams ! “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Malkey Posted November 20, 2018 Share Posted November 20, 2018 A lot of the examples on the forums (found by using the Google search "mousewheel site:autoitscript.com") need the mouse hovering over a GUI to function. This example does not require a GUI. A Window's hook procedure monitors low-level mouse input events, and in particular, mouse wheel events which, together with the pressed "Alt" key, raises and lowers the volume. expandcollapse popup#include <WinAPI.au3> #include <WindowsConstants.au3> #include <Misc.au3> ; Added for _IsPressed() function only. ; Modified from: https://www.autoitscript.com/forum/topic/98716-mouse-wheel-up-and-down-as-a-hotkey/?do=findComment&comment=709911 HotKeySet('{ESC}', '_Close') ; Press "Esc" key to exit. ;If Not IsDeclared('$WM_MOUSEWHEEL') Then Global Const $WM_MOUSEWHEEL = 0x020A ; <----------- Commented out from original script Global Const $tagMSLLHOOKSTRUCT = _ $tagPOINT & _ ';uint mouseData;' & _ 'uint flags;' & _ 'uint time;' & _ 'ulong_ptr dwExtraInfo;' Global $hFunc, $pFunc Global $hHook, $hMod Global $iCounter = 0 ; The variable in question. $hFunc = DllCallbackRegister('_MouseProc', 'lresult', 'int;int;int') $pFunc = DllCallbackGetPtr($hFunc) $hMod = _WinAPI_GetModuleHandle(0) $hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, $pFunc, $hMod) ; $WH_MOUSE_LL - Installs a hook procedure that monitors low-level mouse input events While 1 Sleep(20) WEnd Func _MouseProc($iCode, $iwParam, $ilParam) Local $tMSLL, $iDelta If $iCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $iCode, $iwParam, $ilParam) $tMSLL = DllStructCreate($tagMSLLHOOKSTRUCT, $ilParam) If $iwParam = $WM_MOUSEWHEEL Then $iDelta = BitShift(DllStructGetData($tMSLL, 'mouseData'), 16) If _IsPressed("12") Then ; <----------- Added to original script ("12" for Alt key) If $iDelta < 0 Then $iCounter -= 1 Send("{VOLUME_DOWN}") ; <----------- Added to original script Else $iCounter += 1 Send("{VOLUME_UP}") ; <------------- Added to original script EndIf EndIf ConsoleWrite($iCounter & @LF) EndIf Return _WinAPI_CallNextHookEx($hHook, $iCode, $iwParam, $ilParam) EndFunc ;==>_MouseProc Func _Close() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hHook) Exit EndFunc ;==>_Close 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