AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

loop while hotkey down, depending on active window

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
jamestr



Joined: 05 Apr 2004
Posts: 96
Location: Connecticut USA

PostPosted: Sun Apr 18, 2004 11:36 pm    Post subject: loop while hotkey down, depending on active window Reply with quote

Code:

while mouse button #4 is down, the LMB will hold down, or the pgdn will hold down, depending on foreground window.



SetTitleMatchMode, 2  ;text anywhere in title   

xbutton1::
MouseGetPos, xpos, ypos   
Loop
{
    GetKeyState, state, xbutton1, p
    if state = u
    {
   mouseclick, left, , , , , u
   MouseMove, %xpos%, %ypos% ,1     
   break
     }
     else
   IfWinActive, Smart Explorer
   {
      MouseMove, 790, 450,
      mouseclick, left, , , , , d
   }
   else
      send {pgdn}
      sleep 50
}      
;continue      
return
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Mon Apr 19, 2004 3:03 am    Post subject: Reply with quote

That's nice and it's the first script I've seen that uses an XButton... just when I was starting to think that XButtons never occur in nature.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group