Old versions of Microsoft's IntelliPoint software allowed users to assign the Alt+Tab action to the mouse wheel button. Somewhere after IntelliPoint 4.0 this functionallity was removed.
I wrote the code below to give Alt+Tab functionallity to the mouse wheel button. IntelliPoint is not required. Put the file in your startup folder to have it load every time Windows starts. For example, in Windows XP, you could place it in the folder C:\Documents and Settings\All Users\Start Menu\Programs\Startup.
Click the mouse wheel to switch to the last window viewed. Hold the mouse wheel down to switch to a window of your choice -- no scrolling required.
_______________________________________________
#NoTrayIcon
*MButton::
GetKeyState, CapsState, CapsLock, T
If CapsState = D
SetCapsLockState, Off
Send, {AltDown}{Tab}
Sleep, 200
Loop
{
GetKeyState, WheelState, MButton, P
If WheelState = D
Sleep, 400
GetKeyState, WheelState, MButton, P
If WheelState = D
Send, {Tab}
Else
{
Send, {AltUp}
Break
}
}
Send, {AltUp}
If CapsState = D
SetCapsLockState, On
_______________________________________________
Keywords: alt, tab, alt+tab, alt-tab, switch, mouse, wheel, wheel button, window, next window, last window
Alt+Tab Action for the Mouse Wheel
Started by
Brandon Pace
, Feb 27 2005 06:57 PM
43 replies to this topic
#1
-
Posted 27 February 2005 - 06:57 PM
Nice. If you haven't already, you might try the following as well. I find it quite convenient:
MButton::AltTabMenu
WheelDown::AltTab
WheelUp::ShiftAltTab
Click the wheel to show or hide the menu, and turn it to navigate through the menu. The wheel will still function normally whenever the Alt-Tab menu isn't visible.
MButton::AltTabMenu
WheelDown::AltTab
WheelUp::ShiftAltTab
Click the wheel to show or hide the menu, and turn it to navigate through the menu. The wheel will still function normally whenever the Alt-Tab menu isn't visible.
#2
-
Posted 27 February 2005 - 09:59 PM
Chris, when I try to use this...
MButton::AltTabMenu
WheelDown::AltTab
WheelUp::ShiftAltTab
... it doesn't work correctly. For me it only makes the selected window
flash on the taskbar but it doesn't bring it to the top and it doesn't give focus to it.
When I use something like....
MButton::
Send, {LAlt Down}{TAB}
Sleep, 2000
Send, {LAlt Up}
return
... it does bring the selected window correctly to the top and activates it.
I looked at the source-code and I think it must have to do with this section
in hook_include.cpp:
Anyone else having this behavior?
MButton::AltTabMenu
WheelDown::AltTab
WheelUp::ShiftAltTab
... it doesn't work correctly. For me it only makes the selected window
flash on the taskbar but it doesn't bring it to the top and it doesn't give focus to it.
When I use something like....
MButton::
Send, {LAlt Down}{TAB}
Sleep, 2000
Send, {LAlt Up}
return
... it does bring the selected window correctly to the top and activates it.
I looked at the source-code and I think it must have to do with this section
in hook_include.cpp:
if (alt_tab_menu_is_visible) // Can be true even if which_alt_down is zero. { if (hotkey_id_to_fire != HOTKEY_ID_ALT_TAB_AND_MENU) // then it is MENU or DISMISS. { KeyEvent(KEYUP, which_alt_down ? which_alt_down : VK_MENU); if (this_key.as_modifiersLR && vk != VK_LWIN && vk != VK_RWIN && !key_up) KeyEvent(KEYUP, vk); // Can't send sc here since it's not defined for the mouse hook. alt_tab_menu_is_visible = false; break; } }
Anyone else having this behavior?
#3
-
Posted 02 March 2005 - 07:43 PM
In a world without walls and fences who needs windows and gates?
For those WinXP users who don't know already; the Alt-Tab Replacement Powertoy really comes in handy as it shows previews of windows in Alt-Tab; something I felt like sharing
#5
-
Posted 02 March 2005 - 08:08 PM
autohotkey.com/net Site Manager
Contact me by email (polyethene at autohotkey.net) or message tidbit
I tried that once; it was too slow for me and I like tabbed applications better than SDI's anyway.
#6
-
Posted 02 March 2005 - 08:28 PM
This code
MButton::AltTabMenu WheelDown::AltTab WheelUp::ShiftAltTabworks beautifully! I am still being amazed by this program (AutoHotkey). It is excellent!
#7
-
Posted 09 March 2005 - 01:14 PM
RG
This one is just the best Alt-Tabber: http://taskswitchxp.sourceforge.net/
I recommend (and use) the latest 'n greatest beta version 2.0b4: best http://sourceforge.n...s/taskswitchxp/
HS2
I recommend (and use) the latest 'n greatest beta version 2.0b4: best http://sourceforge.n...s/taskswitchxp/
HS2
#8
-
Posted 09 March 2005 - 03:36 PM
Taskswitch-XP is great, but I don't use it 'cause I've been trying to limit my resource usage lately. Also, it doesn't get along well with Windowblinds, and when an app does that, it's usually not Windowblinds that gets the boot. :wink:
#9
-
Posted 09 March 2005 - 03:49 PM
I found a script I like better than the one I posted previously. This one makes use of the AltTab function Chris suggested. Just press and hold the right mouse button and use the left button to switch between windows. It seems to work fine on Win 2k and XP.
Rbutton & LButton::AltTab $RButton::MouseClick, right
#10
-
Posted 27 April 2005 - 12:08 AM
Here is a slight variation of the above that allows anything that relies on the right mouse to be held down (such as games and right-click-drag of a file in Explorer) to continue to work. However, pressing the right mouse button will cause a right-click-down event, which might cause undesirable side-effects depending on where you click:
~Rbutton & LButton::AltTab
RButton::MouseClick, right,,,,, D
RButton up::MouseClick, right,,,,, U ; This method allows right-click-drag to work.
~Rbutton & LButton::AltTab
RButton::MouseClick, right,,,,, D
RButton up::MouseClick, right,,,,, U ; This method allows right-click-drag to work.
#11
-
Posted 27 April 2005 - 08:25 PM
Thanks Chris for sharing that script.
I was originally trying to get my middle mouse button click to switch between applications. as i rarely use the middle button click event for anything much.
Whatever I tried just wouldnt work, but I know that the middle mouse button is working, as the example from the help file worked, where I could bring up the AltTab menu with middle button click.
this is what tried to get the middle mouse button to switch apps without success;
MButton::AltTab
any ideas?
I was originally trying to get my middle mouse button click to switch between applications. as i rarely use the middle button click event for anything much.
Whatever I tried just wouldnt work, but I know that the middle mouse button is working, as the example from the help file worked, where I could bring up the AltTab menu with middle button click.
this is what tried to get the middle mouse button to switch apps without success;
MButton::AltTab
any ideas?
#12
-
Posted 02 June 2005 - 04:07 PM
The built-in Alt-tab actions require hotkeys that are combination of two keys (such as RControl & RShift::). By contrast, displaying the alt-tab menu/window via AltTabMenu can be assigned to an unmodified hotkey.this is what tried to get the middle mouse button to switch apps without success;
MButton::AltTab
You may have already tried the following example, but if so perhaps you can describe how the behavior you want is different from what it gives:
; Clicking the button will display the menu and turning the wheel will navigate through it:
MButton::AltTabMenu
WheelDown::AltTab
WheelUp::ShiftAltTab
#13
-
Posted 02 June 2005 - 08:39 PM
Hi!
I am searching for the following thing:
If I press the midde mouse button, the task menu appears. Scrolling the mouse wheel up and down, the focused program changes and will be selected with left or middle button mouse button or return. Right button or any other key will escape from the tast menu.
Without prior pressing the middle mouse button, the wheel up and down should behave as before (e.g. for scrolling web pages).
I don't know how to implement this behavior, but perhaps you can help me.
bye, urev
I am searching for the following thing:
If I press the midde mouse button, the task menu appears. Scrolling the mouse wheel up and down, the focused program changes and will be selected with left or middle button mouse button or return. Right button or any other key will escape from the tast menu.
Without prior pressing the middle mouse button, the wheel up and down should behave as before (e.g. for scrolling web pages).
I don't know how to implement this behavior, but perhaps you can help me.
bye, urev
#14
-
Posted 16 August 2005 - 10:38 AM
The following script seems close to what you want. Clicking the middle button will display the menu and turning the wheel will navigate through it. This script is not supported on Windows 9x:
MButton::AltTabMenu
WheelDown::AltTab
WheelUp::ShiftAltTab
MButton::AltTabMenu
WheelDown::AltTab
WheelUp::ShiftAltTab
#15
-
Posted 18 August 2005 - 02:54 AM