Jump to content

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

Send mouse scrolls to window under mouse


  • Please log in to reply
142 replies to this topic
Skrell
  • Members
  • 384 posts
  • Last active: Jul 07 2016 05:03 PM
  • Joined: 23 Aug 2011

Thank you i will try LNick's trick and see how it works for me. 

 

It vexes me that I have to spend time a multi-million company such as Microsoft is unable to come up with better products, while we AHK nuts and other (Classic Shell, 7+ Taskbar Tweaker, etc) are essentially doing their work

 

This is more reason to switch to linux!   If it weren't for gaming i'd stop using Windows all together!  Microsoft sucks..always have always will! 



Scoox
  • Members
  • 194 posts
  • Last active: Jun 09 2017 03:34 AM
  • Joined: 28 Nov 2010

This is more reason to switch to linux!   If it weren't for gaming i'd stop using Windows all together!  Microsoft sucks..always have always will! 

 

Same here, although I am on a different leash (music production software).


RegJump() - Jump to registry path in Regedit

HoverScroll() - HoverScroll() - Scroll controls without focus


Scoox
  • Members
  • 194 posts
  • Last active: Jun 09 2017 03:34 AM
  • Joined: 28 Nov 2010

Today I have explored other ways to scroll controls without focus. The following works and is very simple:

WheelUp::
	MouseGetPos,,,, ControlHwnd, 2
	ControlClick,, ahk_id %ControlHwnd%,, WheelUp
Return

WheelDown::
	MouseGetPos,,,, ControlHwnd, 2
	ControlClick,, ahk_id %ControlHwnd%,, WheelDown
Return

EDIT: After a bit of testing, it appears that the above code doesn't work with all controls, so probably best to ignore it and stick with the PostMessage approach.

 

However, the following does not work:

^WheelUp::
	MouseGetPos,,,, ControlHwnd, 2
	ControlSend,, {Control Down}, ahk_id %ControlHwnd%
	ControlClick,, ahk_id %ControlHwnd%,, WheelUp
	ControlSend,, {Control Up}, ahk_id %ControlHwnd%
Return

^WheelDown::
	MouseGetPos,,,, ControlHwnd, 2
	ControlSend,, {Control Down}, ahk_id %ControlHwnd%
	ControlClick,, ahk_id %ControlHwnd%,, WheelDown
	ControlSend,, {Control Up}, ahk_id %ControlHwnd%
Return

Is there anything wrong with this?


RegJump() - Jump to registry path in Regedit

HoverScroll() - HoverScroll() - Scroll controls without focus


Scoox
  • Members
  • 194 posts
  • Last active: Jun 09 2017 03:34 AM
  • Joined: 28 Nov 2010

Yet, I'd still like to be able to engage and disengage Ctrl outside FocuslessScroll(). Code like the following does not work.

^WheelDown::
    MouseGetPos,,,, ControlHwnd, 2
    ControlSend,, {Control Down}, ahk_id %ControlHwnd%
    FocuslessScroll()
    ControlSend,, {Control Up}, ahk_id %ControlHwnd%
Return

I still have to try sending Control Up and Down using PostMessage. Perhaps if someone here knows how to do this could they share it?


RegJump() - Jump to registry path in Regedit

HoverScroll() - HoverScroll() - Scroll controls without focus


iDrug
  • Members
  • 389 posts
  • Last active: Oct 11 2015 09:24 PM
  • Joined: 13 Oct 2009

You can't just send WheelUp/Down to some controls and expect any scroll actions to happen.

Not all the controls trigger some scrolling whenever they receive scrolling events.

First, you have to find the corresponding control in a program that will trigger scrolling upon receiving scrolling events.



Scoox
  • Members
  • 194 posts
  • Last active: Jun 09 2017 03:34 AM
  • Joined: 28 Nov 2010

You can't just send WheelUp/Down to some controls and expect any scroll actions to happen.

Not all the controls trigger some scrolling whenever they receive scrolling events.

First, you have to find the corresponding control in a program that will trigger scrolling upon receiving scrolling events.

 

So what you are saying is that ControlClick sends the WheelUp/Down message to the specified control, and then it's up to the control to do something about it. I guess this is what this whole thread is about, finding ways to get all controls to respond to WheelUp/Down. So, in theory, if we have managed to do it, would it be possible for this to be integrated into AHK so that all controls could be scrolled by means of ControlClick?


RegJump() - Jump to registry path in Regedit

HoverScroll() - HoverScroll() - Scroll controls without focus


iDrug
  • Members
  • 389 posts
  • Last active: Oct 11 2015 09:24 PM
  • Joined: 13 Oct 2009

So what you are saying is that ControlClick sends the WheelUp/Down message to the specified control, and then it's up to the control to do something about it.

Exactly.

I guess this is what this whole thread is about, finding ways to get all controls to respond to WheelUp/Down.

From what I know - that's just impossible, because it's up to the programs to decide how controls should react to receiving scroll events.
By default, the scroll events get sent to the ~main control of the window. Sometimes the control that should receive scrolling events is different than ~main control, because the program's authors transferred this role to another control. In this case and in case you'd like to send scrolling to a particular control - you have to use PostMessage/ControlSend to the specific control.
That's all more of just my opinion that got formed from my few years experience of scrolling over inactive windows to do stuff in them.

So, in theory, if we have managed to do it, would it be possible for this to be integrated into AHK so that all controls could be scrolled by means of ControlClick?

From what I know - that's just impossible, because there's no way to just find out which control to send events to, because even the
MouseGetPos,,,,Control
method won't help you in quite many cases.

Scoox
  • Members
  • 194 posts
  • Last active: Jun 09 2017 03:34 AM
  • Joined: 28 Nov 2010

I have started a new thread for HoverScroll(), a continuation and improved version of of FocuslessScroll(), which was undeniably very hard to find in this thread as it is buried somewhere in the middle of it and spread over several posts.

 

Click here to go to the HoverScroll() thread.


RegJump() - Jump to registry path in Regedit

HoverScroll() - HoverScroll() - Scroll controls without focus