Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Mouse Scroll support for any window


  • Please log in to reply
6 replies to this topic
Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
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)

;___________________________________________
;______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
;___________________________________________
;______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

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
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.autohotke...topic.php?t=136

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

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

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
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.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
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.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Barky
  • Members
  • 3 posts
  • Last active: May 05 2005 10:12 PM
  • Joined: 09 Jul 2004
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.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
i'm short of time... but will do that soon.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
based on the help from Chris, I've posted another version of the script too... it works nicely.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat