Erik Ruud Posted February 16, 2006 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?
cppman Posted February 16, 2006 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
peter1234 Posted February 16, 2006 Posted February 16, 2006 (edited) look in beta help file for _IsPressed 02 = right mouse button Edited February 16, 2006 by peter1234
cppman Posted February 16, 2006 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
Erik Ruud Posted February 16, 2006 Author 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")
cppman Posted February 17, 2006 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
Erik Ruud Posted February 21, 2006 Author 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.
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