문제

I have looked thoroughly around the interwebs for this, but I was wondering if anyone had a way that I could remap Shift + Tab so that it brings up a context menu like you see in steam. This would have a transparent background, and no window icon. And just like the steam menu, I want it to have stuff that would be useful. I have tried to do this on my own, but I was not successful. Anyone have any ideas?

도움이 되었습니까?

해결책

I feel like this is much more complicated than you make it out to be.

Here is some code to get the fade effect without a window icon. Use Shift+Tab.

#SingleInstance force
#NoTrayIcon
SetBatchLines, -1

SysGet, VirtualWidth, 78
SysGet, VirtualHeight, 79
Transparency := 0
Fade := 0

Settimer, GUI2AlwaysOnTop, 10 ; Keep gui 2 on top

Gui, 1: Default
Gui, Color, 0x000000 ; Color to black
Gui, +LastFound +AlwaysOnTop -Caption +E0x20 ; Click through GUI always on top.
Gui, 1: +owner
WinSet, Transparent, %Transparency%
Gui, Show, x0 y0 w%VirtualWidth% h%VirtualHeight% ; Cover entire screen, may have to adjust X if you have multiple monitors
Return

Shift & Tab::
    If (Fade:=!Fade)
        FadeIn(500, 40)
    Else
        FadeOut(500)
Return

FadeIn(TotalTime = 500, TransFinal = 255)
{
    StartTime := A_TickCount
    Loop
    {
       Transparency := Round(((A_TickCount-StartTime)/TotalTime)*TransFinal)
       WinSet, Transparent, %Transparency%, ahk_class AutoHotkeyGUI
       if (Transparency >= TransFinal)
          break
       Sleep, 10
    }

}

FadeOut(TotalTime = 500)
{
    StartTime := A_TickCount
    Loop
    {
       Transparency := ((TimeElapsed := A_TickCount-StartTime) < TotalTime) ? 100*(1-(TimeElapsed/TotalTime)) : 0
       WinSet, Transparent, %Transparency%, ahk_class AutoHotkeyGUI
       if (Transparency = 0)
          break
       Sleep, 10
    }
}

GUI2AlwaysOnTop:
    Gui, 2: +AlwaysonTop
return

A good amount of the GUI code is from SmartBright. I've had these fade functions around, I know I modified someone else's script to my liking, but I cannot find the source.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top