Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Enhanced ScrollBars like in GENIUS MOUSE? Any script?


  • Please log in to reply
7 replies to this topic
Jedi Kalimero
  • Guests
  • Last active:
  • Joined: --
Hi,

I would like AutoHotkey to treat the Mouse Wheel in the same way the mouse controller for Genius mice and some other brands do:

1-: The wheel moves the scrollbar under the pointer (if any) instead of the scrollbar in the active window (if any). The scrollbar affected can be into an inactive window that remains inactive (so it doesn't come to the front).

2-: Using the SHIFT key in conjunction with the wheel, moves the horizontal scrollbar (if any) instead of the vertical one.

Can this behavior be emulated with AutoHotkey?

I was trying to make some sort of script for the first feature, but without success:

WheelDown::
	    MouseGetPos, , , id, 
	    WinGetTitle, title, ahk_id %id%
	    ControlClick, Control, title, , WheelDown

This should get the id of the window under the pointer, find its title and send a wheeldown to that window, but it doesn't work. I'm posting it here just in case someone gets inspired.

HELP!

Jedi Kalimero
  • Members
  • 3 posts
  • Last active: Feb 08 2014 05:50 AM
  • Joined: 18 May 2005
I have made a script that actually works in the first point of my last mail but i still don't know how to move the horizontal slider instead of the vertical.

The script works at 90% of ScrollBars but there are still some programs that doen't work well. for example, in Mozilla Thunderbird, it works in the folders view, also in the headers view but not in the message view:

WheelDown::
	CoordMode, Mouse, Screen
	MouseGetPos, xmouse, ymouse, id, control
	WinGetPos, xwin, ywin, , , ahk_id %id%
	xpos := xmouse - xwin
	ypos := ymouse - ywin
	ControlClick, X%xpos% Y%ypos%, ahk_id %id%, , WheelDown, ,Pos
	return

WheelUp::
	CoordMode, Mouse, Screen
	MouseGetPos, xmouse, ymouse, id, control
	WinGetPos, xwin, ywin, , , ahk_id %id%
	xpos := xmouse - xwin
	ypos := ymouse - ywin
	ControlClick, X%xpos% Y%ypos%, ahk_id %id%, , WheelUp, ,Pos
	return

It doesn't work well also at the post reply page of this forum. There is a ScrollBar for the page, another one for the reply window and another one for the Topic Review. When you try to use the wheel to move the sliders at the reply window or the Topic review, the main slider is used or no effect at all is obtained.

I'm near the sollution but it still needs some finetuning.

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Here's a method of scrolling the focused control directly rather than sending wheel events:
ControlGetFocus, control, A
SendMessage, 0x115, 1, 0, %control%, A  ; Scroll down (0x115 is WM_VSCROLL).
Sleep 500
SendMessage, 0x115, 0, 0, %control%, A  ; Scroll up (0 vs. 1 causes SB_LINEUP vs. DOWN)
To do the same for the horizontal scroll bar (WM_HSCROLL), substitute 0x114 for 0x115.

There is more info at: <!-- m -->http://www.autohotke...topic.php?t=136<!-- m -->

Jedi Kalimero
  • Members
  • 3 posts
  • Last active: Feb 08 2014 05:50 AM
  • Joined: 18 May 2005
Close but still not perfect.

I have changed the script to this:

WheelDown::
	CoordMode, Mouse, Screen
	MouseGetPos, xmouse, ymouse, id, control
	SendMessage, 0x115, 1, 0, %control%, ahk_id %id% 
	return

WheelUp::
	CoordMode, Mouse, Screen
	MouseGetPos, xmouse, ymouse, id, control
	SendMessage, 0x115, 0, 0, %control%, ahk_id %id%
	return

SHIFT & WheelDown::
	CoordMode, Mouse, Screen
	MouseGetPos, xmouse, ymouse, id, control
	SendMessage, 0x114, 1, 0, %control%, ahk_id %id% 
	return

SHIFT & WheelUp::
	CoordMode, Mouse, Screen
	MouseGetPos, xmouse, ymouse, id, control
	SendMessage, 0x114, 0, 0, %control%, ahk_id %id% 
	return

It works in almost every program, but it doen't work at all in Mozilla thunderbird. Somebody knows why?

If this helps, Mozilla Thunderbird, unlike almost every other program, detects where the pointer is and moves the corresponding scroll slider instead of the one in the active area even if you are not using any special mouse controller or AutoHotKey, so maybe there is some interference between Thunderbird and the way AutoHotKey controls the mouse wheel.

In doesn't work in mozilla Firefox neither. :-(

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Perhaps those particular controls don't obey the WM_VSCROLL message. If you could confirm that through testing, you could have the script revert to Send {WheelDown} for those particular window/control types and use SendMessage for all others.

Edit: Someone asked me for some hotkeys to make the mouse wheel scroll horizontally instead of vertically. Since this seems to fit in with this topic, I'll post it here in case anyone else needs it:
WheelUp::  ; Turning the wheel up scrolls to the left.
ControlGetFocus, FocusedControl, A
SendMessage, 0x114, 0, 0, %FocusedControl%, A  ; 0x114 is WM_HSCROLL
return

WheelDown::   ; Turning the wheel down scrolls to the right.
ControlGetFocus, FocusedControl, A
SendMessage, 0x114, 1, 0, %FocusedControl%, A  ; 1 vs. 0 causes SB_LINEDOWN vs. UP
return


perlsmith
  • Members
  • 89 posts
  • Last active: Jul 08 2018 09:46 PM
  • Joined: 05 Oct 2008
Chris,
Will those work on Win2K? I tried

SHIFT & WheelUp (added the SHIFT & ) with your code and couldn't get it to work. What's a good testcase? I had a PDF open in IE 6.

Thanks

TheAllmighty
  • Guests
  • Last active:
  • Joined: --

Chris,
Will those work on Win2K?

Chris is currently not availiable:
http://de.tinypic.co...p?v=2cgof2p&s=3

PixelEater
  • Members
  • 1 posts
  • Last active: Jul 13 2012 07:17 AM
  • Joined: 13 Jul 2012
I was just going over the last two scripts posted itt and wondering if there's a way to bring them into 2012. They don't activate true scrolling per se, as is evidenced by rapidly hitting the default #MaxHotkeysPerInterval limit using Logitech's freely spinning scroll wheels. Which is one of the only types of wheels providing enough motivation to get these scripts past a snail's pace. So I'm just wondering if anyone has any new ideas on executing genuine side scroll commands just like a mouse would. I want to take advantage of smooth scrolling. Firefox 13 has certainly improved on that and horizontal scroll and I just dusted off my trackball, so if I can just trick AHK into doing this it would be perfect. I know WheelLeft and WheelRight were introduced for 1.0.48+.