bearware Guest
|
Posted: Fri Jul 15, 2005 11:24 am Post subject: deskpager and more controlling windows without a mouse |
|
|
Here a a mousless deskpager
and more ways to control windows without a mouse.
| Code: |
; a deskpager
;copyright richard delorenzi 2005
;you may use this acording to the GPL version 2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; win 1,2,3,or 4 to switch desks
; win/ctrl 1,2,3,or 4 to move active window to desk
;
; win/esc activate next window
; win tab activate next window current to back
; win/shift tab reverse of above
; win s show enabled windows. use to help debug
#SingleInstance
#MaxThreads 1
CurrentDeskId=1
Desk1=
Desk2=
Desk3=
Desk4=
OnExit,Goodbye
;comma seperated window exclusion lists
;Dont be doing any thing importent on your computer when editing this script,
;you may loose you windows.
;The following lists are not perfact
ClassExcludeList = Shell_TrayWnd,IEDummyFrame,#32770,SysShadow,BaseBar
TitleExclusionList =
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; kotkeys
#1::
gosub DeskAuditWindows
gosub DeskHideWindows
CurrentDeskId=1
gosub DeskShowWindows
return
#2::
gosub DeskAuditWindows
gosub DeskHideWindows
CurrentDeskId=2
gosub DeskShowWindows
return
#3::
gosub DeskAuditWindows
gosub DeskHideWindows
CurrentDeskId=3
gosub DeskShowWindows
return
#4::
gosub DeskAuditWindows
gosub DeskHideWindows
CurrentDeskId=4
gosub DeskShowWindows
return
#^1::
ToDeskId=1
gosub DeskMoveWindow
return
#^2::
ToDeskId=2
gosub DeskMoveWindow
return
#^3::
ToDeskId=3
gosub DeskMoveWindow
return
#^4::
ToDeskId=4
gosub DeskMoveWindow
return
#l::
reload
return
#Esc:: ;next window
gosub GotoWindow
return
#+Tab::
gosub GoToBackWindow
return
#Tab:: ;next window send current to back
;send to bottom
WinSet,Bottom,,A
gosub GotoWindow
return
#s:: ;show
gosub DeskFullAuditWindows
Text =
Loop,Parse,DeskAuditList,CSV
{
Id = %A_LoopField%
WinGetTitle,Title,ahk_id %Id%
WinGetClass,Class,ahk_id %Id%
WinGet,Process,ProcessName,ahk_id %Id%
Text = %Text%%Id%,%Title%,%Class%,%Process%`n
}
MsgBox,%Text%
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
GotoWindow:
;activate next window
gosub ReverseDeskAuditWindows
;MsgBox,List: %DeskAuditList%
Loop,Parse,DeskAuditList,CSV
{
if A_LoopField
{
WinGet,State,MinMax,ahk_id %A_LoopField%
;MsgBox,%A_LoopField% %State%
IfNotEqual,State,-1
{
;MsgBox,%A_LoopField%
ifWinNotActive, ahk_id %A_LoopField%
{
WinActivate,ahk_id %A_LoopField%
break
}
}
}
}
return
GoToBackWindow:
WinActivateBottom,,,Program Manager
return
GoodBye:
gosub DeskShowAllWindows
ExitApp
DeskMoveWindow:
gosub DeskAuditWindows
winget,thisid,Id,A
If ThisId in %DeskAuditList%
{
ifNotEqual CurrentDeskId,%ToDeskId%
{
ListSoFar := Desk%ToDeskId%
Desk%ToDeskId% = %ThisId%,%ListSoFar%
WinHide,ahk_id %ThisId%
}
}
return
DeskShowAllWindows:
Loop,4
{
;hMsgBox,%A_index%
CurrentDeskId=%A_Index%
gosub DeskShowWindows
}
return
ReverseDeskAuditWindows:
gosub DeskAuditWindows
List=
Loop,Parse,DeskAuditList,CVS
{
List=%A_LoopField%,%List%
}
DeskAuditList=%List%
return
DeskAuditWindows:
SetWinDelay,0
DeskAuditList=
WinGet,Windows,List,,,Program Manager
Loop %Windows%
{
ThisId := Windows%a_index%
WinGetClass,Class,ahk_id %ThisId%
WinGetTitle,Title,ahk_id %ThisId%
If Class not in %ClassExcludeList%
{
If Title not in %TitleExclusionList%
{
;MsgBox,Class:%Class%
ListSoFar = %DeskAuditList%
DeskAuditList = %ListSoFar%,%ThisId%
}
}
}
;MsgBox,%DeskAuditList%
return
DeskFullAuditWindows:
SetWinDelay,0
DeskAuditList=
WinGet,Windows,List,,,Program Manager
Loop %Windows%
{
ThisId := Windows%a_index%
ListSoFar = %DeskAuditList%
DeskAuditList = %ListSoFar%,%ThisId%
}
return
DeskHideWindows:
SetWinDelay,0
Desk%CurrentDeskId% = %DeskAuditList%
CurrentDesk := Desk%CurrentDeskId%
Loop,Parse,CurrentDesk,CSV
{
if %A_LoopField%
{
;MsgBox,%A_LoopField%
WinHide,ahk_id %A_LoopField%
}
}
return
DeskShowWindows:
SetWinDelay,0
SplashImage,,B,,Desk %CurrentDeskId%,VirtualDesktop_SplashScreen,FM10
;WinMove,VirtualDesktop_SplashScreen,,10,10
WinSet,Transparent,128,VirtualDesktop_SplashScreen
CurrentDesk := Desk%CurrentDeskId%
Loop,Parse,CurrentDesk,CSV
{
if %A_LoopField%
{
;MsgBox,%A_LoopField%
WinShow,ahk_id %A_LoopField%
}
}
SetTimer,DeskBannerOff,1000
return
DeskBannerOff:
SplashImage,off
SetTimer,DeskBannerOff,Off
return
|
|
|