 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Link68759 Guest
|
Posted: Thu Aug 14, 2008 2:48 pm Post subject: AltTab and commands |
|
|
At first, I made a script which uses the mousewheel and my side button to scroll through the windows in alt tab. Then, I decided to make the windows accessed through the script centered automatically, and return them to their first location when they aren't the active window.
My only issue is, I can't seem to have the Alt tab and extra script attach to one key combo.
| Code: | XButton1 & WheelUp::
Send +{Alt down}{Tab}
Loop
{
GetKeyState, state, XButton1, P
If state = U
break
}
Send {Alt up}
WinGetActiveTitle, WinTitle
WinGetPos,x,y, Width, Height, %WinTitle%
WinMove, %WinTitle%,, (A_ScreenWidth/2)-(Width/2), (A_ScreenHeight/2)-(Height/2)
WinWaitNotActive, %WinTitle%
WinMove, %WinTitle%,,x,y
return
XButton1 & WheelDown::
Send {Alt down}{Tab}
Loop
{
GetKeyState, state, XButton1, P
If state = U
break
}
Send {Alt up}
WinGetActiveTitle, WinTitle
WinGetPos,x,y, Width, Height, %WinTitle%
WinMove, %WinTitle%,, (A_ScreenWidth/2)-(Width/2), (A_ScreenHeight/2)-(Height/2)
WinWaitNotActive, %WinTitle%
WinMove, %WinTitle%,,x,y
return |
I think this script is buggy because it doesn't want to send alt down more than once. Would there be a way to assign the wheel and xbutton to AltTab, then have it execute script whenever the hotkey is executed? (preferably after the xbutton1 is lifted). When I tried
| Code: | XButton1 & WheelUp::
ShiftAltTab
etc |
it said that ShiftAltTab was not a command. |
|
| Back to top |
|
 |
Razlin
Joined: 05 Nov 2007 Posts: 454 Location: canada
|
Posted: Thu Aug 14, 2008 5:13 pm Post subject: |
|
|
| Code: | XButton1 & WheelUp::
send ShiftAltTab
etc |
you cant "send alt tab" or send {alt} {tab}
read documentation on "alttab"
anyhow.. my fix above should solve your problem. _________________ -=Raz=- |
|
| Back to top |
|
 |
Link68759 Guest
|
Posted: Thu Aug 14, 2008 5:16 pm Post subject: |
|
|
| tried that, and just now. it sends the text AltTab. |
|
| Back to top |
|
 |
Red Hat Boy
Joined: 10 Apr 2008 Posts: 111
|
Posted: Thu Aug 14, 2008 5:26 pm Post subject: |
|
|
You could have replaced | Code: | Loop
{
GetKeyState, state, XButton1, P
If state = U
break
} | withbut it seems that if whatever XButton1 & WheelUp is assigned to has stopped it, it won't execute again.
Anyway, try this:
| Code: | *$WheelUp::
GetKeyState, state, XButton1, p
if state = D
{
if ActiveMode != 2
{
if ActiveMode = 1
Send, {Shift down}{Tab}
else
Send {Shift down}{Alt down}{Tab}
ActiveMode = 2
}
else
Send, {Tab}
}
else
Send, {WheelUp}
;
return
*$WheelDown::
GetKeyState, state, XButton1, p
if state = D
{
if ActiveMode != 1
{
if ActiveMode = 2
Send {Shift up}{Tab}
else
Send {Alt down}{Tab}
ActiveMode = 1
}
else
Send, {Tab}
}
else
Send, {WheelDown}
;
return
~*$XButton1 up::
if ActiveMode
{
if ActiveMode = 2
Send {Shift up}
Send {Alt up}
WinGetActiveTitle, WinTitle
WinGetPos,x,y, Width, Height, %WinTitle%
WinMove, %WinTitle%,, (A_ScreenWidth/2)-(Width/2), (A_ScreenHeight/2)-(Height/2)
SetTimer, MoveWindow, -1
ActiveMode = 0
}
return
MoveWindow:
WinTitlePrev = %WinTitle%
xPrev = %x%
yPrev = %y%
WinWaitNotActive, %WinTitlePrev%
WinMove, %WinTitlePrev%,,xPrev,yPrev
return |
I dont' have an XButton1, so I replaced it with x, and it worked...but it was also constantly typing xxxxxxxxxxxxxxxxxxxxxx...  _________________ I slit the sheet, the sheet I slit,
and on the slitted sheet I sit. ;~} |
|
| Back to top |
|
 |
Link68759 Guest
|
Posted: Thu Aug 14, 2008 6:40 pm Post subject: |
|
|
perfect! thanks. I don't seem to have the repeating error- xbutton1 functions normally as a browser/explorer back button by itself, and scrolls through the tabbing with the windows moving about correctly.
thanks again
-Link |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|