geekhack
geekhack Community => Keyboards => Topic started by: MANISH7 on Fri, 05 March 2010, 18:40:14
-
forgive me for my lack of knowledge on this matter but i don't know how to write AHK scripts. it is so complicated for a seemingly modest request.
i just want the (1) right alt to be windows key and (2) right control to be right mouse click (3) pause break mutes the volume (4) left control + down arrow lowers volume (5) right control + up arrow increases the volume.
i tried some sample scripts listed at the AKK website but i didn't know how to customize it. i have a cherry mx11800 & windows 7. i did a search prior to this thread. everyone recommended AHK but writing scripts is another matter. can someone please help me?
-
Try
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other <myemail@nowhere.com>
;
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
RAlt::LWin
RCtrl::Rbutton
Pause::
Send {Volume_Mute}
SoundGet, master_mute, , mute
if(master_mute = "on")
{
Tooltip, Mute On
}else
{
Tooltip, Mute Off
}
SetTimer, RemoveToolTip, 2000
return
LCtrl & Down::
SoundSet -5
SoundGet, master_volume
voltip := Round(master_volume)
Tooltip, Vol: %voltip%`%
SetTimer, RemoveToolTip, 2000
return
RCtrl & Up::
SoundSet +5
SoundGet, master_volume
voltip := Round(master_volume)
Tooltip, Vol: %voltip%`%
SetTimer, RemoveToolTip, 2000
return
RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return
You can learn a lot from the built-in help even though it can be confusing at first (right click the green H in the system tray while you have any AHK script running and choose help.)
I copied all the volume code from someone else's script though. :smile:
-
very kind of you and i appreciate it.
control + up or down arrow work to change volume but only after i click on the volume bar.
EDIT: sorry for the mix up. the rest work great thanks for your kind help! volume up and down isn't a big deal.
-
i apologize! windows key works, right mouse click works, pause button for mute works too! sorry i didn't set it up right the first time! thanks a lot!
-
well everything seems to work fine. i think ahk is a little buggy on windows 7 for now. the left control + down arrow lowers the volume. left control + up arrow will not increase the volume. however, right control + up arrow will increase the volume. right control + down arrow does not lower the volume. so i mix and match and it works.
i will back up this script for future uses.
thanks so much for your help. i'm all set. i really appreciate it.
-
Maybe I read your original post too literally. You can change the places where it says LCtrl or RCtrl to simply Ctrl where you want either control key to work.
Like this:
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other <myemail@nowhere.com>
;
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
RAlt::LWin
RCtrl::Rbutton
Pause::
Send {Volume_Mute}
SoundGet, master_mute, , mute
if(master_mute = "on")
{
Tooltip, Mute On
}else
{
Tooltip, Mute Off
}
SetTimer, RemoveToolTip, 2000
return
Ctrl & Down::
SoundSet -5
SoundGet, master_volume
voltip := Round(master_volume)
Tooltip, Vol: %voltip%`%
SetTimer, RemoveToolTip, 2000
return
Ctrl & Up::
SoundSet +5
SoundGet, master_volume
voltip := Round(master_volume)
Tooltip, Vol: %voltip%`%
SetTimer, RemoveToolTip, 2000
return
RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return
-
hey thanks so much. sorry about that - i did not realize that i had miswritten my original post. i made the corrections you suggested and everything is now working flawlessly! i'm glad you took my post literally - that is how i always mean them. i just made a typo. yesterday i had a long day :)
thanks to your mod there's nothing more i could want from my cherry keyboard. it's excellent. it's got the windows keys & media buttons that i needed. i really appreciate it! you've resolved for me everything.