;; Volume adjustment ---------------------------------------------------------- ;; -> body /* XButton2::SendInput, {XButton2} XButton2 & WheelUp::SetVolume(GetKeyState("Shift") ? 2 : 1) XButton2 & WheelDown::SetVolume(GetKeyState("Shift") ? -2 : -1) */ RAlt & F6::SetVolume(GetKeyState("Shift") ? 2 : 1) RAlt & F5::SetVolume(GetKeyState("Shift") ? -2 : -1) ;; -> library SetVolume(n) { SoundGet, s s := round(s) + n if (s > 100) s := 100 if (s < 0) s := 0 SoundSet, %s% OSD(s) } /* SetVolume(n) { global wMax static vMin := 4 SoundGet, s SoundGet, w, WAVE s := round(s) w := round(w) if (s > vMin or w > wMax) wMax := w else if (wMax = "") wMax := 100 v := s + w - wMax + n if (v > 100) v := 100 if (v >= vMin) { s := v w := wMax } else { s := vMin w := wMax - vMin + v } SoundSet, %s% SoundSet, %w%, WAVE OSD(v) ; display volume on screen } */ ;; On-screen display ---------------------------------------------------------- ;; -> init Gui, OSD:+AlwaysOnTop +LastFound +Owner +Disabled -Caption Gui, OSD:Color, FFFFFF Gui, OSD:Font, s30, VCR OSD Mono Gui, OSD:Add, Text, vOSD c00BB00, % " " WinSet, TransColor, FFFFFF 250 y := A_ScreenHeight - 100 Gui, OSD:Show, x0 y%y% AutoSize NA, OSD ;; -> library OSD(text) { SetTimer, RemoveOSD, Off WinSet, AlwaysOnTop, On, OSD GuiControl, OSD:Text, OSD, %text% SetTimer, RemoveOSD, 3000 return } RemoveOSD: SetTimer, RemoveOSD, Off GuiControl, OSD:Text, OSD, % " " return