AutoHotkey Community

It is currently May 26th, 2012, 8:45 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: July 4th, 2008, 2:25 am 
Offline

Joined: June 15th, 2008, 8:01 am
Posts: 111
Location: Sydney, Australia
Control the master fader via a mouse gesture, or remote presenter mouse in my case. I did it like this because the remote mouse has limited buttons and wanted to maximise the controls and this is one of them.

I use a mousemove so every time a gesture takes place it resets its position. Fastest mouse speed, 0, works best. The actual mouse positon doesnt really matter as long as it's fairly central to the vertical on the screen, otherwise if to close to top or bottom defeats the purpose of the mousemove reset. Therefore the volume wont work if the mouse reaches the vertical limitations of the screen.

I have added a master reset (mute) for the volume and an auto activate for the ScrollLock key everytime the code is activated.

*ScrollLock key to turn on/off
*Ctrl+m to mute

Code:
SetTimer, KeepRunning
GetKeyState, state, scrolllock, T
if state = U
{
send {ScrollLock}
Send {Volume_down 50}
}
KeepRunning:
GetKeyState, state, scrolllock, T  ; scroll lock on/off
if state = D ; enable hotkeys and volume control effect
{
Suspend, off
settimer, gesture, 2
}
else ; disable all hotkeys and volume control effect
{
suspend, on
settimer, gesture, off
}
return

~MButton::Send {Volume_down 50}  ; mute

gesture:
mousegetpos,,yposA
Nx:=(yposB-yposA)
Fx:=((yposB-yposA)**2)
if Nx < -1
{
   send {volume_down}
   mousemove, 0, 200, 0
}
else if Nx > 1
{
   send {volume_up}
   mousemove, 0, 200, 0
}
else
yposA=yposB
mousegetpos,,yposB
return

BTW.. This is only tested on Vista so not sure if it works on any other OS.

::BONUS CREDITS:: go out to LeeKohl and Red Hat Boy for ideas


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], fusion1920, SKAN, Stigg, tomL and 18 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group