AutoHotkey Community

It is currently May 26th, 2012, 5:40 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: June 20th, 2004, 8:43 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
This script will add mouse scroll support to those windows which inherently don't support it.

Run script.
ctrl + left click on the target window's scroll up (or left) button.
ctrl + left click on the target window's scroll down (or right) button.

that's it... now scroll normally! : )

(number of lines to be scrolled is configurable)

Code:
;___________________________________________
;______Add Scroll Support   -  Rajat________


#SingleInstance force
CoordMode, ToolTip, Screen
SetDefaultMouseSpeed, 0
SetMouseDelay, -1




lines = 3


ToolTip, Control+Left click on Scroll-Up button, 1, 1
Hotkey, ^lbutton, up


exit


up:
   Loop
   {
      GetKeyState, State, LButton
      if State = U
         Break
      Sleep, 10
   }
   Hotkey, ^lbutton, down
   MouseGetPos, upX, upY
   WinGet, winID, ID, A
   ToolTip, Control+Left click on Scroll-Down button, 1, 1
Return

down:
   Hotkey, ^lbutton, off
   MouseGetPos, dnX, dnY
   ToolTip
   Hotkey, ~WheelDown, ScrDn
   Hotkey, ~WheelUp, ScrUp
Return

ScrDn:
   IfWinNotExist, ahk_id %winID%,, ExitApp
   IfWinNotActive, ahk_id %winID%,, Return
   MouseGetPos, X, Y
   MouseClick, L, %dnX%, %dnY%, %lines%
   MouseMove, %X%, %Y%
Return

ScrUp:
   IfWinNotExist, ahk_id %winID%,, ExitApp
   IfWinNotActive, ahk_id %winID%,, Return
   MouseGetPos, X, Y
   MouseClick, L, %upX%, %upY%, %lines%
   MouseMove, %X%, %Y%
Return


Another Version
Code:
;___________________________________________
;______Add Scroll Support   -  Rajat________


#SingleInstance force
CoordMode, ToolTip, Screen
SetDefaultMouseSpeed, 0
SetMouseDelay, -1




lines = 3


ToolTip, Control+Left click on window (control) to scroll), 1, 1
Hotkey, ^lbutton, select
exit


select:
   Loop
   {
      GetKeyState, State, LButton
      if State = U
         Break
      Sleep, 10
   }
   Hotkey, ^lbutton, off
   WinGet, winID, ID, A
   ControlGetFocus, control, A
   ToolTip
   Hotkey, ~WheelDown, ScrDn
   Hotkey, ~WheelUp, ScrUp
Return


ScrUp:
   IfWinNotExist, ahk_id %winID%,, ExitApp
   IfWinNotActive, ahk_id %winID%,, Return
   Loop, %lines%
      SendMessage, 0x115, 0, 0, %control%, ahk_id %winID%
Return

ScrDn:
   IfWinNotExist, ahk_id %winID%,, ExitApp
   IfWinNotActive, ahk_id %winID%,, Return
   Loop, %lines%
      SendMessage, 0x115, 1, 0, %control%, ahk_id %winID%
Return

_________________
Image


Last edited by Rajat on July 25th, 2004, 8:30 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2004, 5:14 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
That's a nice idea. To summarize, my understanding is that it adds wheel support to applications that refuse to scroll in response to turning the wheel.

The following might be even better because it avoids the need to click on the controls when the script first starts. It might not work in every case. The below is from http://www.autohotkey.com/forum/viewtopic.php?t=136

; PGUP
ControlGetFocus, control, A
SendMessage, 0x115, 0, 0, %control%, A

; PGDN
ControlGetFocus, control, A
SendMessage, 0x115, 1, 0, %control%, A


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2004, 9:25 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
thanx, i'll try your suggestion.

i did this script in 5 mins after i got frustrated with an app that refused to use mouse wheel. after making this script i've used it for 4-5 other apps too. its mostly for old apps that i sometimes need to use.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2004, 10:06 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
I just checked it with 2 apps and its working cool. thanx!

by the way it scrolls one line at a time and not a page, which is better as i use the code thrice to scroll 3 lines.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Like how?
PostPosted: July 25th, 2004, 1:48 am 
Offline

Joined: July 9th, 2004, 3:52 am
Posts: 3
That has got to be the most useful script I've seen here yet. I'm not clear on how to integrate Chris' suggestion in to Rajat's script, however. Could someone clarify that for me? Thanks.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 25th, 2004, 7:33 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
i'm short of time... but will do that soon.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 25th, 2004, 8:31 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
based on the help from Chris, I've posted another version of the script too... it works nicely.

_________________
Image


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: XX0 and 15 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