Erik Ruud Posted February 16, 2006 Share Posted February 16, 2006 I have been searching the forum for two hours, and I can't seem to find the answer I need. I'd like to have a script that can detect when the right mouse button is clicked and perform a function. This should work just like a HotKey. I have written many scripts in AutoIt V2 in the past, but I am new to V3. I have most of my script working including the function that will be run when the button is clicked. I have tested it with a regular HotKeySet. HotKeySet does not appear to have an option for the mouse buttons. Am I missing something obvious? Link to comment Share on other sites More sharing options...
cppman Posted February 16, 2006 Share Posted February 16, 2006 (edited) I have been searching the forum for two hours, and I can't seem to find the answer I need.I'd like to have a script that can detect when the right mouse button is clicked and perform a function.This should work just like a HotKey.I have written many scripts in AutoIt V2 in the past, but I am new to V3.I have most of my script working including the function that will be run when the button is clicked. I have tested it with a regular HotKeySet. HotKeySet does not appear to have an option for the mouse buttons.Am I missing something obvious?maybe u can do likeWhile 1if _isPressed(MouseButton) then Function()EndIfWend? Edited February 16, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
peter1234 Posted February 16, 2006 Share Posted February 16, 2006 (edited) look in beta help file for _IsPressed 02 = right mouse button Edited February 16, 2006 by peter1234 Link to comment Share on other sites More sharing options...
cppman Posted February 16, 2006 Share Posted February 16, 2006 here is an example code... #include <misc.au3> While 1 If _isPressed("01") then _Mouseonclick() Else ;;; EndIf Wend Func _Mouseonclick() MsgBox(0, "Example", "Example") EndFunc Miva OS Project Link to comment Share on other sites More sharing options...
Erik Ruud Posted February 16, 2006 Author Share Posted February 16, 2006 here is an example code... #include <misc.au3> While 1 If _isPressed("01") then _Mouseonclick() Else ;;; EndIf Wend Func _Mouseonclick() MsgBox(0, "Example", "Example") EndFunc Thanks for the help. I can make that work for me, but I would have really liked it to work like a HotKey and intercept the mouse click. Something like HotKeySet({RightMouseClick},"_Mouseonclick") Link to comment Share on other sites More sharing options...
cppman Posted February 17, 2006 Share Posted February 17, 2006 Thanks for the help.I can make that work for me, but I would have really liked it to work like a HotKey and intercept the mouse click. Something like HotKeySet({RightMouseClick},"_Mouseonclick")np. I'll try to work on making something like that... if i can... lol. Miva OS Project Link to comment Share on other sites More sharing options...
Erik Ruud Posted February 21, 2006 Author Share Posted February 21, 2006 I went with this so I could exit the script if the prgram window was closed. I also set a hot key for {ESC} to exit the script as well. While WinExists($window) if $reload <> "no" then If _isPressed("02") then _Mouseonclick() EndIf Endif Wend Thanks again for the help. 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