Code: Select all
~LWin::
WinGetTitle, window, A
WinShow, ahk_class Shell_TrayWnd
WinActivate, ahk_class Shell_TrayWnd
return
~LWin Up::
WinActivate, %window%
Sleep 1000
WinHide, ahk_class Shell_TrayWnd
return
Code: Select all
~LWin::
WinGetTitle, window, A
WinShow, ahk_class Shell_TrayWnd
WinActivate, ahk_class Shell_TrayWnd
return
~LWin Up::
WinActivate, %window%
Sleep 1000
WinHide, ahk_class Shell_TrayWnd
return
Code: Select all
$LWin::
WinGetTitle, title, A
WinShow, ahk_class Shell_TrayWnd
WinActivate, ahk_class Shell_TrayWnd
KeyWait, LWin
Sleep 100
WinActivate, %title%
Sleep 1000
WinHide, ahk_class Shell_TrayWnd
return
Code: Select all
$LWin::
WinGetTitle, title, A
if (A_PriorHotkey <> "$LWin" or A_TimeSincePriorHotkey > 400)
{
WinShow, ahk_class Shell_TrayWnd
WinActivate, ahk_class Shell_TrayWnd
KeyWait, LWin
Sleep 100
WinActivate, %title%
Sleep 750
WinHide, ahk_class Shell_TrayWnd
return
}
WinShow, ahk_class Shell_TrayWnd
WinActivate, ahk_class Shell_TrayWnd
return
Code: Select all
~LWin Up::
KeyWait, LAlt, D T0.1 ; wait for 0.1s for other hotkey combos used with LAlt
If ErrorLevel ; LAlt was not pressed in time
{
IfWinNotActive, ahk_class Shell_TrayWnd
WinActivate, ahk_class Shell_TrayWnd
Else
Send, {Lwin} ; open start menu
}
return
Code: Select all
~LWin::
keyPressed := 0 ; initialize check variable
KeyWait, LAlt, D T0.1 ; wait for 0.1s for other hotkeys with LAlt
If ErrorLevel = 0 ; LAlt was pressed in time
{
keyPressed := 1
}
Else
{
WinGet, originalID, ID, A ; get current window ID
Loop
{
WinGet, winID, ID, A
Sleep 50
If (winID = originalID) ; no new window opened
continue
Else ; window was opened
keyPressed := 1
break
}
}
return
LWin Up::
If (keyPressed = 0)
{
IfWinNotActive, ahk_class Shell_TrayWnd
WinActivate, ahk_class Shell_TrayWnd
Else
Send, {Lwin}
}
return
Code: Select all
~LWin::
keyPressed := 0
WinGet, lastID, ID, A
While GetKeyState("LWin", "P")
{
WinGet, nextID, ID, A
Sleep 50
If GetKeyState("LAlt", "P")
keyPressed := 1
}
If (nextID != lastID)
keyPressed := 1
return
LWin Up::
If (keyPressed = 0)
{
IfWinNotActive, ahk_class Shell_TrayWnd
WinActivate, ahk_class Shell_TrayWnd
Else
Send, {Lwin}
}
return
Code: Select all
~LWin::
IfWinActive, ahk_class Shell_TrayWnd
Send, {Lwin} ; opens start menu
Else
{
keyPressed := 0
WinGet, lastID, ID, A ; stores window ID to anticipate window change
While GetKeyState("LWin", "P")
{
WinGet, nextID, ID, A ; checks for window change
Sleep 50
If GetKeyState("LAlt", "P") ; used for combo hotkeys "#!s" etc
keyPressed := 1
}
WinGet, IDProcess, ProcessName, ahk_id %nextID%
If (nextID != lastID) ; window changed
{
keyPressed := 1
}
If (keyPressed = 0)
WinActivate, ahk_class Shell_TrayWnd
}
return
LWin Up::
return
Code: Select all
~LWin::
IfWinActive, ahk_class Shell_TrayWnd
Send, {Lwin} ; opens start menu
Else
{
keyPressed := 0
While GetKeyState("LWin", "P")
{
Sleep 50
If (A_ThisHotKey != "~LWin") ; supposed to check if any other key was pressed
{
ToolTip, %A_ThisHotKey%`n%A_PriorHotKey%`n%keyPressed% ; for testing
keyPressed := 1
}
}
If (keyPressed = 0)
WinActivate, ahk_class Shell_TrayWnd
}
return
LWin Up::
return
Code: Select all
#Persistent
SetTimer, LWin, 250
LWin:
CoordMode, Mouse
MouseGetPos,, MY
If GetKeyState("LWin","P") Or MY > A_ScreenHeight - 40
WinShow, ahk_class Shell_TrayWnd
Else
WinHide, ahk_class Shell_TrayWnd
Return
Users browsing this forum: Araphen, mcd, rubeusmalfoy, ShatterCoder and 82 guests