AutoHotkey Community

It is currently May 26th, 2012, 9:37 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: August 13th, 2009, 7:13 pm 
Offline

Joined: January 13th, 2008, 6:00 pm
Posts: 115
I am trying to have an accelerated scroll as mentioned elsewhere on the forum using the code below, which I have revised several times. Unfortunately, I cannot get the code to work reliably in Firefox 3.0.13, especially within a frame that is a pdf opened with the Adobe Acrobat browser plugin. It is working properly in other apps. What do you suggest? I have tried all Send modes: Input, Event, and Play. Play did not work right at all. Using ControlSend (Input mode) sending to the control MozillaWindowClass4 worked ok, except within a pdf loaded in the browser.

Code:
#MaxThreadsBuffer On
#IfWinActive, ahk_group WheelByPage
WheelUp::Send {PgUp}
WheelDown::Send {PgDn}
#IfWinActive
#MaxThreadsPerHotkey 5
#IfWinActive, ahk_class MozillaUIWindowClass
$WheelUp::
   If(A_ThisHotkey = A_PriorHotkey && A_TimeSincePriorHotkey < 70)
   SendPlay {PgUp}
   Else SendPlay {WheelUp}
   Return
   
$WheelDown::
   If(A_ThisHotkey = A_PriorHotkey && A_TimeSincePriorHotkey < 70)
   SendPlay {PgDn}
   Else SendPlay {WheelDown}
   Return
#IfWinActive
$WheelUp::
   If(A_ThisHotkey = A_PriorHotkey && A_TimeSincePriorHotkey < 70)
   Send {PgUp}
   Else Click WheelUp
   Return
   
$WheelDown::
   If(A_ThisHotkey = A_PriorHotkey && A_TimeSincePriorHotkey < 70)
   Send {PgDn}
   Else Click WheelDown
   Return
#MaxThreadsPerHotkey 1
#MaxThreadsBuffer Off


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 13th, 2009, 8:17 pm 
Offline

Joined: February 2nd, 2009, 2:03 pm
Posts: 112
This is what I use, someone on the forum posted it because I needed it. It will auto scroll up or down just by hovering over the scroll bar in Firefox, perfect for me since I hate clicking, thought I would share it with you, hope it helps:

http://www.autohotkey.com/forum/viewtopic.php?p=285065&highlight=#285065

Code:
#Persistent
#NoEnv
SetBatchLines,-1
SetTimer,CheckScroll
Return
CheckScroll:
MouseGetPos,,,,control
If loop
   Return
loop=1
Loop {
   MouseGetPos,,,,control
   If control!=MozillaWindowClass4
      break
   MouseGetPos, ax,ay
   Sleep, 50
   MouseGetPos,bx,by
   Send % (ay<by ? "{WheelDown " : "{WheelUp ") . round(Abs(ay-by)/(GetKeyState("Shift","P") ? 10 : 1)) . "}"
}
loop=
SetTimer,CheckScroll
Return


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: JSLover, virpara and 61 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group