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 

Firefox Scroll Wheel Problems

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
instantrunoff



Joined: 13 Jan 2008
Posts: 115

PostPosted: Thu Aug 13, 2009 6:13 pm    Post subject: Firefox Scroll Wheel Problems Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
ballyhairs



Joined: 02 Feb 2009
Posts: 112

PostPosted: Thu Aug 13, 2009 7:17 pm    Post subject: Reply with quote

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#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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help 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