Jump to content

unL33T

Members
  • Posts

    4
  • Joined

  • Last visited

unL33T's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Thanks! I subbed my code into your sample and sure enough it works! I wish I understood more about how this works.
  2. When I click the middle mouse button I don't want the middle mouse button to be sent to whatever program is open. Just whatever I put in my script. The script performs different actions depending on which window is active.
  3. When I press the middle mouse button I want to perform some key combos, then hold a different mouse button until I release the one I am pressing, then do some more key combos without passing the original mouse button to the active window. I can get it all to work except that the button being pressed is also sent to the active window. Is this possible? I've tried a number of solutions but they all either block mouse movement (required), mess with mouse movement even when the button isn't pressed, or cause the script to think I released the button. #include <Misc.au3> Opt("WinTitleMatchMode", 2) ;match partial names of windows MsgBox($MB_SYSTEMMODAL, "Window", "Script started.") Func OneNotePan() Send("{alt}dy") MouseDown($MOUSE_CLICK_LEFT) While _IsPressed("04") ;do nothing while the middle button is held WEnd MouseUp($MOUSE_CLICK_LEFT) Send("{Alt}dt{Alt}h{Esc}{Esc}") EndFunc Func AcrobatPan() ;MsgBox($MB_SYSTEMMODAL, "Window", "Acrobat is active.") Send("{Space down}") MouseDown($MOUSE_CLICK_LEFT) While _IsPressed("04") ;do nothing while the middle button is held WEnd MouseUp($MOUSE_CLICK_LEFT) Send("{Space up}") EndFunc Func VisioPan() Send("{CtrlDown}{ShiftDown}") MouseDown($MOUSE_CLICK_RIGHT) While _IsPressed("04") ;do nothing while the middle button is held WEnd MouseUp($MOUSE_CLICK_RIGHT) Send("{CtrlUp}{ShiftUp}") EndFunc Func IdentifyApp() ;MsgBox($MB_SYSTEMMODAL, "Window", "Middle button down.") if WinActive("OneNote") Then OneNotePan() Elseif WinActive("Acrobat") Then AcrobatPan() ;MsgBox($MB_SYSTEMMODAL, "Window", "Acrobat is active.") Elseif WinActive("Visio") Then VisioPan() ;MsgBox($MB_SYSTEMMODAL, "Window", "Visio is active.") EndIf EndFunc while 1 if _IsPressed("04") Then IdentifyApp() Sleep (500) ;keep script running WEnd
  4. Tried to use this but when I set the middle mouse button as a hotkey it blocks all mouse movement while the button is held. Undesired functionality. I just want the middle mouse button not passed on to the active window. Almost there, though.
×
×
  • Create New...