Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ******
- GREASE
- ******
- This module adjusts the transparency of the active window by units of 10 using #Ins/#Del. Adding the Ctrl or Shift modifiers allows the user to fine-tune the transparency by reducing the increment to 5, 2, or 1 (hold down both).
- */
- *#Insert::
- *#Delete::
- *#WheelUp::
- *#WheelDown::
- ; This calculates the adjustment factor then passes it on to the function DoTrans
- Trans := 10 * (GetKeyState("Ctrl") ? .5 : 1) * (GetKeyState("Alt") ? .2 : 1)
- If (A_ThisHotkey = "*#Insert" || A_ThisHotkey = "*#WheelUp")
- DoTrans(Trans)
- Else
- DoTrans(-Trans)
- Return
- DoTrans(change) {
- WinGet, old, Transparent, A
- If (old = "")
- old := 255
- new := old + change
- WinSet, Transparent, %new%, A
- If (new => 255) ; saves resources when 100% opaque
- WinSet, Transparent, OFF, A
- Return
- }
- /*
- ***
- PIN
- ***
- This will toggle always-on-top mode for the current window using #Home and display a helpful (if long) tooltip which displays the title of that window. #End always works as an un-pinner.
- When using the mouse button hotkeys, it uses whichever window the cursor is over.
- */
- #Home::
- *#XButton2::
- WinSet, AlwaysOnTop, Toggle, A
- WinGetActiveTitle, wintit
- WinGet, ExStyle, ExStyle, %wintit%
- If (ExStyle & 0x8)
- ToolTipDisplay(tt . wintit . " pinned!",-1000)
- Else
- ToolTipDisplay(tt . wintit . " unpinned!",-1000)
- Return
- #End::
- *#XButton1::
- WinSet, AlwaysOnTop, Off, A
- WinGetActiveTitle, wintit
- ToolTipDisplay(tt . wintit . " unpinned!",-1000)
- Return
Advertisement
Add Comment
Please, Sign In to add comment