blackhydra866 Posted January 10, 2009 Share Posted January 10, 2009 I'm still really terrible at making scripts and i'd really like something to quickly change the master volume of my computer on the fly. I just got a really nice gaming headset so it would be nice to have this right now. Also I don't have a keyboard with a volume shortcut. I want F9 to mute all, F11 to increase master volume up a tick, and F12 to decrease master volume a tick. (i don't want to use F10 since that exits most steam games like TF2 instantly ) Thanks in advance. Link to comment Share on other sites More sharing options...
BrettF Posted January 10, 2009 Share Posted January 10, 2009 Hi, Take a look at: HotKeySet ("") And for changing the volume, try sending "{VOLUME_UP}", and "{VOLUME_DOWN}" Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Andreik Posted January 10, 2009 Share Posted January 10, 2009 Try this (NOT TESTED): HotKeySet("{PAUSE}","Quit");Press PAUSE to quit HotKeySet("{F9}","VolumeMute") HotKeySet("{F11}","VolumeUp") HotKeySet("{F12}","VolumeDown") While 1 Sleep(50) WEnd Func Quit() Exit EndFunc Func VolumeMute() Send("{VOLUME_MUTE}") EndFunc Func VolumeUp() Send("{VOLUME_UP}") EndFunc Func VolumeDown() Send("{VOLUME_DOWN}") EndFunc When the words fail... music speaks. Link to comment Share on other sites More sharing options...
blackhydra866 Posted January 10, 2009 Author Share Posted January 10, 2009 It all worked except for F12, when I hit it it does nothing. The script looks fine to me though.. Link to comment Share on other sites More sharing options...
DangerousDan Posted January 10, 2009 Share Posted January 10, 2009 from help file. I had the same issue with another app. The following hotkeys cannot be set: Ctrl+Alt+Delete It is reserved by Windows F12 It is also reserved by Windows, according to its API. NumPad's Enter Key Instead, use {Enter} which captures both Enter keys on the keyboard. Win+B,D,E,F,L,M,R,U; and Win+Shift+M These are built-in Windows shortcuts. Note: Win+B and Win+L might only be reserved on Windows XP and above. Alt, Ctrl, Shift, Win These are the modifier keys themselves! Other Any global hotkeys a user has defined using third-party software, any combos of two or more "base keys" such as '{F1}{F2}', and any keys of the form '{LALT}' or '{ALTDOWN}'. Link to comment Share on other sites More sharing options...
GEOSoft Posted January 10, 2009 Share Posted January 10, 2009 It all worked except for F12, when I hit it it does nothing. The script looks fine to me though..Some systems reserve the F12 key for other uses and it should not be used as a hotkey. There used to be a warning in the help file about that but I can't seem to find it now. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
blackhydra866 Posted January 10, 2009 Author Share Posted January 10, 2009 (edited) Thanks a lot for the help so far guys! But i'm having a little problem now. I've changed the code to this: HotKeySet("{SCROLLLOCK}","Quit");Press PAUSE to quit HotKeySet("{PAUSE}","VolumeMute") HotKeySet("{PGUP}","VolumeUp") HotKeySet("{PGDOWN}","VolumeDown") While 1 Sleep(50) WEnd Func Quit() Exit EndFunc Func VolumeMute() Send("{VOLUME_MUTE}") EndFunc Func VolumeUp() Send("{VOLUME_UP}") EndFunc Func VolumeDown() Send("{VOLUME_DOWN}") EndFunc But for some reason when I hit page down to turn the volume down a tick it actually pans the master volume to the left a tick instead. Everything else works fine. Really strange. Edited January 10, 2009 by blackhydra866 Link to comment Share on other sites More sharing options...
Andreik Posted January 10, 2009 Share Posted January 10, 2009 Thanks a lot for the help so far guys! But i'm having a little problem now. I've changed the code to this: HotKeySet("{SCROLLLOCK}","Quit");Press PAUSE to quit HotKeySet("{PAUSE}","VolumeMute") HotKeySet("{PGUP}","VolumeUp") HotKeySet("{PGDOWN}","VolumeDown") While 1 Sleep(50) WEnd Func Quit() Exit EndFunc Func VolumeMute() Send("{VOLUME_MUTE}") EndFunc Func VolumeUp() Send("{VOLUME_UP}") EndFunc Func VolumeDown() Send("{VOLUME_DOWN}") EndFunc But for some reason when I hit page down to turn the volume down a tick it actually pans the master volume to the left a tick instead. Everything else works fine. Really strange.HotKeySet("{SCROLLLOCK}","Quit");Press SCROLLLOCK to quit HotKeySet("{PAUSE}","VolumeMute") HotKeySet("{PGUP}","VolumeUp") HotKeySet("{PGDN}","VolumeDown") While 1 Sleep(20) WEnd Func Quit() Exit EndFunc Func VolumeMute() Send("{VOLUME_MUTE}") EndFunc Func VolumeUp() Send("{VOLUME_UP}") EndFunc Func VolumeDown() Send("{VOLUME_DOWN}") EndFunc When the words fail... music speaks. Link to comment Share on other sites More sharing options...
blackhydra866 Posted January 10, 2009 Author Share Posted January 10, 2009 Thanks a lot man! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now