DonationCoder.com Forum

DonationCoder.com Software => Coding Snacks => Post New Requests Here => Topic started by: Smobu on May 24, 2008, 01:43 AM

Title: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: Smobu on May 24, 2008, 01:43 AM
IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar

1. Hover anywhere on the taskbar and start scrolling up or down on the mouse wheel.

2. Scroll up to cycle through applications to the left.

3. Scroll down to cycle through applications to the right.
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: Perry Mowbray on May 24, 2008, 05:46 AM
I use TaskSwithchXP (http://www.ntwind.com/software/taskswitchxp.html) to do that, sort of...

1. Click on Tray Icon (not hover over taskbar)
2. Scroll up/down to selected application (don't have to move the mouse)
3. Scroll Wheel click to select (don't have to move the mouse)

Gives me a live display of the windows:
[ You are not allowed to view attachments ]

Actually, previously I was using the TAB+Alt key combination, but in replying to this I've discovered that a click on the Tray Icon is actually much quicker if I've got the mouse in my hand (so thanks for your post!!)
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: lanux128 on May 24, 2008, 09:48 AM
you can take the Windows built-in Alt+Esc shortcut and bind it to mouse-wheel with Autohotkey (http://www.autohotkey.com). try using Alt+Esc or Alt+Shift+Esc to see if that's the behaviour you want. here's the rather basic AHK code for that, doesn't have taskbar detection, though. i can make a more complete script once i get back to my desk.

#SingleInstance,Force
#NoEnv
SendMode,Input

WheelUp::
  Send !{Esc}
Return
WheelDown::
  Send !{Shift}{Esc}
Return
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: Perry Mowbray on May 25, 2008, 08:38 PM
you can take the Windows built-in Alt+Esc shortcut and bind it to mouse-wheel with Autohotkey (http://www.autohotkey.com). try using Alt+Esc or Alt+Shift+Esc to see if that's the behaviour you want. here's the rather basic AHK code for that, doesn't have taskbar detection, though. i can make a more complete script once i get back to my desk.

 :Thmbsup:

I use Alt-TAB all the time but had forgotten about Alt-Esc: Thanks
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: lanux128 on May 25, 2008, 11:44 PM
I use Alt-TAB all the time but had forgotten about Alt-Esc: Thanks
-Perry Mowbray (May 25, 2008, 08:38 PM)
you're welcome. btw, Skrommel had already created a somewhat similar script that needs no user intervention. check out the link below.. 8)

• DONE: timed alt+tab through active windows (https://www.donationcoder.com/forum/index.php?topic=567.msg3415#msg3415)
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: AndyM on May 26, 2008, 08:38 AM
How about using Lanux128's script, but add a few lines to check the mouse cursor position.  If the cursor is over the taskbar, send the Alt-Esc or Alt-Shift-Esc.  (You'll probably get this when Lanux128 is back at his desk ;))
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: lanux128 on May 26, 2008, 10:58 AM
actually i'm not sure whether to continue with this because the original requester has not replied yet if he wants to replicate the 'Alt+Esc' behaviour. :)
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: Smobu on May 26, 2008, 06:48 PM
The alt-esc method is ok, but I was wondering if it is possible for the hover detection to be implemented.
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: lanux128 on May 26, 2008, 10:55 PM
okay, there's an opening for guinea beta testers, please download and give this a try. ;)
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: sri on May 26, 2008, 11:25 PM
lanux: I can see the taskbar items getting focus but the windows themselves are not coming to the foreground. Also some taskbar items are being skipped.
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: lanux128 on May 26, 2008, 11:45 PM
do you have any mouse-enhancer tools running in the background? if not check this setting in the control panel..

[ You are not allowed to view attachments ]
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: sri on May 26, 2008, 11:52 PM
I had volumouse running. Closed it but still the same.

I do already have the mouse wheel settings as per your screenshot.
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: lanux128 on May 26, 2008, 11:59 PM
now, this is strange. what else could be the reason - are you using the .ahk or .exe version? try both versions to see if there is any change.. if the problem persists maybe we could chat over irc for more troubleshooting.
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: sri on May 27, 2008, 12:32 AM
The script works as it should. I didn't know that Alt+Esc only cycles maximized windows and it ignores minimized windows.

Lanux is going to work on modifying this so it works on all windows whether or not they are maximized or minimized.

10:54 lanux128 maybe mouse-wheel on the taskbar can do an alt+tab, what do you think?
10:56 srikat I want the script to bring up immediate next/previous window regardless of window state (minimized or maximized)
10:56 srikat when the mouse wheel is scrolled anywhere on the taskbar
10:57 srikat next/previous relative to the current active window
10:58 lanux128 maybe i can modify the existing script to make a custom script for you..
10:58 srikat I belive that's what the original thread poster wanted as well
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: Smobu on May 27, 2008, 01:14 AM
Thanks for creating the script. I not all too concern about making the minimized windows being able to pop out, but it would be a nice feature to have.
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: lanux128 on May 27, 2008, 01:32 AM
Thanks for creating the script. I not all too concern about making the minimized windows being able to pop out, but it would be a nice feature to have.

you're welcome.. as sri mentions in the earlier post, i'll be making a slightly different script but not based on Alt+Tab either as the internal order of the windows is not as seen on the taskbar. ;)

• What is the Alt+Tab order? (http://blogs.msdn.com/oldnewthing/archive/2003/10/20/55367.aspx)
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: lanux128 on May 27, 2008, 11:11 PM
while trawling through the AHK forums, i came upon this script (http://www.autohotkey.com/forum/viewtopic.php?p=111795#111795) which is very impressive, to say the least. all it needs is a tiny modification to work with the MouseWheel. so i PM'ed the author for his permission to post it here and also invited him over. while waiting for his reply, i thought i'd just update here.. :up:

• Script to Scroll Sequentially Across Taskbar (http://www.autohotkey.com/forum/viewtopic.php?p=111795#111795).
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: sri on May 28, 2008, 12:41 AM
lanux: Presently that script uses ctrl+9 to switch to next window and ctrl+8 to switch to previous window.

I've replaced ^9 with ~WheelUp and ^8 with ~WheelDown.

How do I restrict the script to work only when the mouse is over the taskbar?
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: lanux128 on May 28, 2008, 12:58 AM
How do I restrict the script to work only when the mouse is over the taskbar?

you can make it work conditionally by adding these lines below in each of the WheelUp/Down command.
{
MouseGetPos, , , id, control
WinGetClass, class, ahk_id %id%
If class = Shell_TrayWnd
.
.
.
}

i'm also attaching the modified script, subject to the original author's permission. 8)
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: sri on May 28, 2008, 01:02 AM
works pretty good. Thanks lanux and the original author.
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: urlwolf on May 28, 2008, 03:05 AM
Great idea.
I tried the ahk code, but it didn't work for me.
My mouse drivers are kind of funky... but the wheel does work on all other programs.
I placed the mouse on the task bar, and moved the wheel. Nothing happened.

Is there any way to debug what may be causing the problem?

Thanks
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: lanux128 on May 28, 2008, 04:57 AM
Is there any way to debug what may be causing the problem?

i have only tested in WinXP (SP3) but for debug purpose, you can add the line in bold and see if when the mouse is over the taskbar, the tooltip shows the 'ahk_class' as "Shell_TrayWnd". that should give a clue as to whether the taskbar is detected properly.

...
If class = Shell_TrayWnd
  {
  ToolTip, ahk_class %class%
   i = 0
...
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: sri on May 28, 2008, 12:09 PM
I wrote a small blog post about this at http://www.howtotuts.com/2008/05/28/how-to-switch-windows-by-scrolling-the-mouse/
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: lanux128 on May 30, 2008, 11:40 PM
I wrote a small blog post about this at http://www.howtotuts.com/2008/05/28/how-to-switch-windows-by-scrolling-the-mouse/

good work on Sri on the blog and the name-change. :Thmbsup: also adding a note in the original thread (http://www.autohotkey.com/forum/viewtopic.php?p=111795#111795) at the AHK forums would be nice.
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: Smobu on May 31, 2008, 08:31 PM
The new script also doesn't seem to work for me. It is non-responsive when I try to to scroll on the taskbar. I'm using Vista.
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: lanux128 on June 01, 2008, 01:07 AM
The new script also doesn't seem to work for me. It is non-responsive when I try to to scroll on the taskbar. I'm using Vista.
did the earlier script work in Vista? if no, then follow the suggestion i made to urlwolf (https://www.donationcoder.com/forum/index.php?topic=13444.msg114631#msg114631) and let me know the Vista taskbar's handle.
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: Smobu on June 02, 2008, 08:01 PM
The early script did work for me, but the alt esc does not recognize the incremental order if windows are selected out of order from their placement on the taskbar.

For the second script I placed the debug lines on the bottom of the script, but it did not make an error message come out.
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: lanux128 on June 02, 2008, 08:48 PM
For the second script I placed the debug lines on the bottom of the script, but it did not make an error message come out.

by bottom, i hope you meant the section i showed in the earlier post. btw, there will be no error messages, only a tooltip showing the "class" of the taskbar. i'll try to get someone with Vista to try this script then maybe i'll have an idea.
Title: Re: IDEA: Mouse Wheel Scroll Can Cycle Through Applications on Taskbar
Post by: Smobu on June 03, 2008, 12:15 AM
I initially place the code in the wrong place, but after I put the code in the right way it shows "ahk_class Shell_TrayWnd" as the tooltip.