BrewManNH Posted November 20, 2013 Share Posted November 20, 2013 I know some things are difficult for some people to understand but as an mvp you should know that you can set your mouse buttons however you want via the mouse settings without even having to use autoit for that part. Then you can use hotkeyset function to the key you set your mouse. For example if you set your mouse button as keystroke 5 then hotkeyset with keystroke 5 would work. This is the easy way. Having a mouse with more than left, right and mouse wheel buttons means that you have probably a driver installed for the mouse with the setting running on the background. Chek them out. So, on a standard computer installation, you can't use hotkeyset with a mouse button. Isn't that what I said several posts back? If you want to remap your mouse button so that when you press the left button it triggers the 5 key feel free, myself I prefer my mouse buttons to do what they should be doing so I can use the mouse normally. Hawkysoft 1 If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Hawkysoft Posted November 20, 2013 Author Share Posted November 20, 2013 So, on a standard computer installation, you can't use hotkeyset with a mouse button. Isn't that what I said several posts back? If you want to remap your mouse button so that when you press the left button it triggers the 5 key feel free, myself I prefer my mouse buttons to do what they should be doing so I can use the mouse normally. Same for me, unless there would be a way to remap em with autoit when the script is active and unmap em when it's not active anymore, I could atleast live with that however would rather keep its functionality Link to comment Share on other sites More sharing options...
Malkey Posted November 20, 2013 Share Posted November 20, 2013 This appears to work. expandcollapse popup; Modified from:- ; http://www.autoitscript.com/forum/index.php?showtopic=98716&view=findpost&p=709911 #include <WinAPI.au3> #include <WindowsConstants.au3> Global $hHook Local $hFunc, $pFunc, $hMod HotKeySet('{ESC}', '_Close') $hFunc = DllCallbackRegister('_MouseProc', 'lresult', 'int;int;int') $pFunc = DllCallbackGetPtr($hFunc) $hMod = _WinAPI_GetModuleHandle(0) $hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, $pFunc, $hMod) While 1 Sleep(20) WEnd Func _MouseProc($iCode, $iwParam, $ilParam) If $iCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $iCode, $iwParam, $ilParam) Switch $iwParam Case $WM_LBUTTONUP MsgBox(4096, "", "Left Mouse up", 2) Case $WM_RBUTTONDOWN MsgBox(4096, "", "Right Mouse Down", 2) Case $WM_XBUTTONUP MsgBox(4096, "", "XButton up", 2) EndSwitch Return _WinAPI_CallNextHookEx($hHook, $iCode, $iwParam, $ilParam) EndFunc ;==>_MouseProc Func _Close() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hHook) Exit EndFunc ;==>_Close pixelsearch 1 Link to comment Share on other sites More sharing options...
Hawkysoft Posted November 22, 2013 Author Share Posted November 22, 2013 (edited) This appears to work. expandcollapse popup; Modified from:- ; http://www.autoitscript.com/forum/index.php?showtopic=98716&view=findpost&p=709911 #include <WinAPI.au3> #include <WindowsConstants.au3> Global $hHook Local $hFunc, $pFunc, $hMod HotKeySet('{ESC}', '_Close') $hFunc = DllCallbackRegister('_MouseProc', 'lresult', 'int;int;int') $pFunc = DllCallbackGetPtr($hFunc) $hMod = _WinAPI_GetModuleHandle(0) $hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, $pFunc, $hMod) While 1 Sleep(20) WEnd Func _MouseProc($iCode, $iwParam, $ilParam) If $iCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $iCode, $iwParam, $ilParam) Switch $iwParam Case $WM_LBUTTONUP MsgBox(4096, "", "Left Mouse up", 2) Case $WM_RBUTTONDOWN MsgBox(4096, "", "Right Mouse Down", 2) Case $WM_XBUTTONUP MsgBox(4096, "", "XButton up", 2) EndSwitch Return _WinAPI_CallNextHookEx($hHook, $iCode, $iwParam, $ilParam) EndFunc ;==>_MouseProc Func _Close() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hHook) Exit EndFunc ;==>_Close I know mate, thanks for your eforts, but that's not the way we were discussing atm, also don't want a switch because of performance(trying to get everything fast as possible) Edited November 22, 2013 by Hawkysoft Link to comment Share on other sites More sharing options...
Rogue5099 Posted November 22, 2013 Share Posted November 22, 2013 (edited) If you just want to remap your mouse you can try X-Mouse then maybe attach a function to it. Edited November 22, 2013 by Rogue5099 My projects: Inventory / Mp3 Inventory, Computer Stats Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 22, 2013 Moderators Share Posted November 22, 2013 Hawkysoft, don't want a switch because of performance(trying to get everything fast as possible)Malkey's solution using a low-level mouse hook is about as fast as you can get. I would not dismiss it so readily. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Hawkysoft Posted November 22, 2013 Author Share Posted November 22, 2013 (edited) Hawkysoft, Malkey's solution using a low-level mouse hook is about as fast as you can get. I would not dismiss it so readily. M23 But how to define if it was xbutton1 or 2 than? >.<, ofcourse I've tried this (not saying no to something I didn't test) I actually tested to see if it returned an unique param, however for some reason i get 2 parameters from the $ilParam which can be on both keys e.a. xbutton1 returns ***24414 e.a. xbutton1 than returns ****14421 same does xbutton2 with the same numbers (was so happy to see a unique number in start when pressing x1 and x2, however after clicking it a few times the numbers shown on both places ;/ which btw makes me wonder why this happens, since according to msdn it should return a unique param?) @Rogue5099 Looks like a nifty program, but rather would be interested in writing it in AI instead of using extra software to accomplish this (if id start to actually remap the keys instead of a actual function) Edited November 22, 2013 by Hawkysoft Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 22, 2013 Moderators Share Posted November 22, 2013 Hawkysoft,MSDN is your friend. If you look here you can see that the low-order word of $wParam holds that information. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Hawkysoft Posted November 22, 2013 Author Share Posted November 22, 2013 (edited) Hawkysoft, MSDN is your friend. If you look here you can see that the low-order word of $wParam holds that information. M23 Hey Melba23 I tried $iwParam as well, but it returns a static value on both buttons, they arent different from eachother ;/ Or should i try to get the value $wParam itself? cant test atm will soon Edited November 22, 2013 by Hawkysoft Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 22, 2013 Moderators Share Posted November 22, 2013 Hawkysoft,I do not have Xbuttons on my mouse so I cannot test any of this for you but I wonder if you looked for the $WM_XBUTTONDOWN event and checked then to see if you get a different value? I did find it a bit strange that you got the info as the button was released. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Hawkysoft Posted November 22, 2013 Author Share Posted November 22, 2013 (edited) Hawkysoft, I do not have Xbuttons on my mouse so I cannot test any of this for you but I wonder if you looked for the $WM_XBUTTONDOWN event and checked then to see if you get a different value? I did find it a bit strange that you got the info as the button was released. M23 oh maybe i did forgot to mention that i tested it with $WM_XBUTTONDOWN ofcourse i did that <edit> #include <winapi.au3> #include <WindowsConstants.au3> Global $hHook Local $hFunc, $pFunc, $hMod HotKeySet('{ESC}', '_Close') $hFunc = DllCallbackRegister('_MouseProc', 'long', 'int;wparam;lparam') $pFunc = DllCallbackGetPtr($hFunc) $hMod = _WinAPI_GetModuleHandle(0) $hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, $pFunc, $hMod) While 1 Sleep(20) WEnd Func _MouseProc($iCode, $iwParam, $ilParam) If $iCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $iCode, $iwParam, $ilParam) Switch $iwParam Case $WM_XBUTTONDOWN MsgBox(4096, "", $iCode & ':' & $iwParam & ':' & $ilParam, 2) EndSwitch Return _WinAPI_CallNextHookEx($hHook, $iCode, $iwParam, $ilParam) EndFunc Func _Close() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hHook) Exit EndFunc this is what i tested... for some reason the values from ilparam are always different everytime you rune the script iwparam is always 523 notmather what xbutton been used Edited November 22, 2013 by Hawkysoft Link to comment Share on other sites More sharing options...
Solution mikell Posted November 22, 2013 Solution Share Posted November 22, 2013 To get infos about xbuttons there is a little modification to do #include <winapi.au3> #include <WindowsConstants.au3> HotKeySet('{ESC}', '_Close') Global Const $MSLLHOOKSTRUCT = $tagPOINT & ";dword mouseData;dword flags;dword time;ulong_ptr dwExtraInfo" Global $hHook Local $hFunc, $pFunc, $hMod $hFunc = DllCallbackRegister('_MouseProc', 'long', 'int;wparam;lparam') $pFunc = DllCallbackGetPtr($hFunc) $hMod = _WinAPI_GetModuleHandle(0) $hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, $pFunc, $hMod) While 1 Sleep(20) WEnd Func _MouseProc($iCode, $iwParam, $ilParam) If $iCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $iCode, $iwParam, $ilParam) Local $info = DllStructCreate($MSLLHOOKSTRUCT, $ilParam) Switch $iwParam Case $WM_XBUTTONDOWN MsgBox(4096, "", "XButton " & _WinAPI_HiWord(DllStructGetData($info, "mouseData"))) EndSwitch Return _WinAPI_CallNextHookEx($hHook, $iCode, $iwParam, $ilParam) EndFunc Func _Close() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hHook) Exit EndFunc Hawkysoft 1 Link to comment Share on other sites More sharing options...
Hawkysoft Posted November 24, 2013 Author Share Posted November 24, 2013 To get infos about xbuttons there is a little modification to do #include <winapi.au3> #include <WindowsConstants.au3> HotKeySet('{ESC}', '_Close') Global Const $MSLLHOOKSTRUCT = $tagPOINT & ";dword mouseData;dword flags;dword time;ulong_ptr dwExtraInfo" Global $hHook Local $hFunc, $pFunc, $hMod $hFunc = DllCallbackRegister('_MouseProc', 'long', 'int;wparam;lparam') $pFunc = DllCallbackGetPtr($hFunc) $hMod = _WinAPI_GetModuleHandle(0) $hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, $pFunc, $hMod) While 1 Sleep(20) WEnd Func _MouseProc($iCode, $iwParam, $ilParam) If $iCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $iCode, $iwParam, $ilParam) Local $info = DllStructCreate($MSLLHOOKSTRUCT, $ilParam) Switch $iwParam Case $WM_XBUTTONDOWN MsgBox(4096, "", "XButton " & _WinAPI_HiWord(DllStructGetData($info, "mouseData"))) EndSwitch Return _WinAPI_CallNextHookEx($hHook, $iCode, $iwParam, $ilParam) EndFunc Func _Close() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hHook) Exit EndFunc you rock, thank you so much! Link to comment Share on other sites More sharing options...
mikell Posted November 24, 2013 Share Posted November 24, 2013 Thanks for the cute green label If you are interested there is an other way, low-level interception too with similar performances but without hook - and maybe less cpu usage Link to comment Share on other sites More sharing options...
Hawkysoft Posted November 25, 2013 Author Share Posted November 25, 2013 Thanks for the cute green label If you are interested there is an other way, low-level interception too with similar performances but without hook - and maybe less cpu usage Oh would love to hear that one as well Link to comment Share on other sites More sharing options...
mikell Posted November 25, 2013 Share Posted November 25, 2013 Ok let's go Here an invisible gui is needed - sort of 'message only' - to get the WM_INPUT message expandcollapse popup#include <GUIConstantsEx.au3> #Include <WindowsConstants.au3> HotKeySet('{ESC}', '_Exit') Global Const $RID_INPUT = 0x10000003 Global Const $RIDEV_INPUTSINK = 0x00000100 Global Const $RI_MOUSE_BUTTON_4_DOWN = 0x0040 Global Const $RI_MOUSE_BUTTON_5_DOWN = 0x0100 Global Const $RIM_TYPEMOUSE = 0 If Not IsDeclared('WM_INPUT') Then Global Const $WM_INPUT = 0x00FF Global Const $tagRAWINPUTDEVICE = 'ushort usUsagePage;ushort usUsage;dword dwFlags;hwnd hwndTarget;' Global Const $tagRAWINPUTHEADER = 'dword dwType;dword dwSize;hwnd hDevice;uint_ptr wParam;' Global Const $tagRAWMOUSE = 'ushort usFlags;ushort usAlignment;ushort usButtonFlags;' & _ 'ushort usButtonData;ulong ulRawButtons;long lLastX;long lLastY;ulong ulExtraInformation' Global Const $tagRAWINPUT_MOUSE = $tagRAWINPUTHEADER & $tagRAWMOUSE ;====================================== $hGUI = GUICreate("test") ; fake GUIRegisterMsg($WM_INPUT, 'WM_INPUT') $tRID_M = DllStructCreate($tagRAWINPUTDEVICE) $pRID_M = DllStructGetPtr($tRID_M) $iRID_M = DllStructGetSize($tRID_M) $tRIH = DllStructCreate($tagRAWINPUTHEADER) $pRIH = DllStructGetPtr($tRIH) $iRIH = DllStructGetSize($tRIH) DllStructSetData($tRID_M, 'usUsagePage', 0x01) DllStructSetData($tRID_M, 'usUsage', 0x02) DllStructSetData($tRID_M, 'dwFlags', $RIDEV_INPUTSINK) DllStructSetData($tRID_M, 'hwndTarget', $hGUI) _RegisterRawInputDevices($pRID_M, 1, $iRID_M) While 1 Sleep(10) WEnd ;========================================= Func WM_INPUT($hwnd, $iMsg, $iwParam, $ilParam) Local $tRI_M, $pRI_M, $iRI_M, $iSize $tRI_M = DllStructCreate($tagRAWINPUT_MOUSE) $pRI_M = DllStructGetPtr($tRI_M) $iRI_M = DllStructGetSize($tRI_M) _GetRawInputData($ilParam, $RID_INPUT, $pRI_M, $iRI_M, $iRIH) Local $Flags = DllStructGetData($tRI_M, 'usButtonFlags') Select Case BitAND($Flags, $RI_MOUSE_BUTTON_4_DOWN) MsgBox(4096, "", "XButton 1") Case BitAND($Flags, $RI_MOUSE_BUTTON_5_DOWN) MsgBox(4096, "", "XButton 2") EndSelect Return $GUI_RUNDEFMSG EndFunc ;=================================== Func _Exit() Exit EndFunc Func _GetRawInputData($hRawInput, $iCommand, $pData, ByRef $iSize, $iSizeHeader, $hDll = 'user32.dll') Local $aRet $aRet = DllCall($hDll, 'uint', 'GetRawInputData', 'hwnd', $hRawInput, 'uint', $iCommand, 'ptr', $pData, 'uint*', $iSize, 'uint', $iSizeHeader) If @error Or $aRet[0] = 4294967295 Then Return SetError(1, 0, $aRet[0]) $iSize = $aRet[4] Return $aRet[0] EndFunc Func _RegisterRawInputDevices($pRawInputDevices, $iNumDevices, $iSize, $hDll = 'user32.dll') Local $aRet $aRet = DllCall($hDll, 'int', 'RegisterRawInputDevices', 'ptr', $pRawInputDevices, 'uint', $iNumDevices, 'uint', $iSize) If @error Or $aRet[0] = 0 Then SetError(1, 0, 0) Return $aRet[0] EndFunc I was too lazy to translate, but the funcs used exist in WinApiEx.au3 and the examples provided in the UDF are very explicit (_WinAPI_GetRawInputData , _WinAPI_RegisterRawInputDevices) Searching in Google "mouse hook vs raw input" will give you more infos about these 2 ways Hawkysoft 1 Link to comment Share on other sites More sharing options...
Hawkysoft Posted November 26, 2013 Author Share Posted November 26, 2013 Ok let's go Here an invisible gui is needed - sort of 'message only' - to get the WM_INPUT message expandcollapse popup#include <GUIConstantsEx.au3> #Include <WindowsConstants.au3> HotKeySet('{ESC}', '_Exit') Global Const $RID_INPUT = 0x10000003 Global Const $RIDEV_INPUTSINK = 0x00000100 Global Const $RI_MOUSE_BUTTON_4_DOWN = 0x0040 Global Const $RI_MOUSE_BUTTON_5_DOWN = 0x0100 Global Const $RIM_TYPEMOUSE = 0 If Not IsDeclared('WM_INPUT') Then Global Const $WM_INPUT = 0x00FF Global Const $tagRAWINPUTDEVICE = 'ushort usUsagePage;ushort usUsage;dword dwFlags;hwnd hwndTarget;' Global Const $tagRAWINPUTHEADER = 'dword dwType;dword dwSize;hwnd hDevice;uint_ptr wParam;' Global Const $tagRAWMOUSE = 'ushort usFlags;ushort usAlignment;ushort usButtonFlags;' & _ 'ushort usButtonData;ulong ulRawButtons;long lLastX;long lLastY;ulong ulExtraInformation' Global Const $tagRAWINPUT_MOUSE = $tagRAWINPUTHEADER & $tagRAWMOUSE ;====================================== $hGUI = GUICreate("test") ; fake GUIRegisterMsg($WM_INPUT, 'WM_INPUT') $tRID_M = DllStructCreate($tagRAWINPUTDEVICE) $pRID_M = DllStructGetPtr($tRID_M) $iRID_M = DllStructGetSize($tRID_M) $tRIH = DllStructCreate($tagRAWINPUTHEADER) $pRIH = DllStructGetPtr($tRIH) $iRIH = DllStructGetSize($tRIH) DllStructSetData($tRID_M, 'usUsagePage', 0x01) DllStructSetData($tRID_M, 'usUsage', 0x02) DllStructSetData($tRID_M, 'dwFlags', $RIDEV_INPUTSINK) DllStructSetData($tRID_M, 'hwndTarget', $hGUI) _RegisterRawInputDevices($pRID_M, 1, $iRID_M) While 1 Sleep(10) WEnd ;========================================= Func WM_INPUT($hwnd, $iMsg, $iwParam, $ilParam) Local $tRI_M, $pRI_M, $iRI_M, $iSize $tRI_M = DllStructCreate($tagRAWINPUT_MOUSE) $pRI_M = DllStructGetPtr($tRI_M) $iRI_M = DllStructGetSize($tRI_M) _GetRawInputData($ilParam, $RID_INPUT, $pRI_M, $iRI_M, $iRIH) Local $Flags = DllStructGetData($tRI_M, 'usButtonFlags') Select Case BitAND($Flags, $RI_MOUSE_BUTTON_4_DOWN) MsgBox(4096, "", "XButton 1") Case BitAND($Flags, $RI_MOUSE_BUTTON_5_DOWN) MsgBox(4096, "", "XButton 2") EndSelect Return $GUI_RUNDEFMSG EndFunc ;=================================== Func _Exit() Exit EndFunc Func _GetRawInputData($hRawInput, $iCommand, $pData, ByRef $iSize, $iSizeHeader, $hDll = 'user32.dll') Local $aRet $aRet = DllCall($hDll, 'uint', 'GetRawInputData', 'hwnd', $hRawInput, 'uint', $iCommand, 'ptr', $pData, 'uint*', $iSize, 'uint', $iSizeHeader) If @error Or $aRet[0] = 4294967295 Then Return SetError(1, 0, $aRet[0]) $iSize = $aRet[4] Return $aRet[0] EndFunc Func _RegisterRawInputDevices($pRawInputDevices, $iNumDevices, $iSize, $hDll = 'user32.dll') Local $aRet $aRet = DllCall($hDll, 'int', 'RegisterRawInputDevices', 'ptr', $pRawInputDevices, 'uint', $iNumDevices, 'uint', $iSize) If @error Or $aRet[0] = 0 Then SetError(1, 0, 0) Return $aRet[0] EndFunc I was too lazy to translate, but the funcs used exist in WinApiEx.au3 and the examples provided in the UDF are very explicit (_WinAPI_GetRawInputData , _WinAPI_RegisterRawInputDevices) Searching in Google "mouse hook vs raw input" will give you more infos about these 2 ways Thank you mate, i'll have a play with this 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