Recommended Posts

Hello,

Where's Herby at?!

Before I start in on a script, I'd like to know if anyone is aware of a AutoHotkey script that allows you to use the mouse as a media controller? Who needs a remote when you've got a bluetooth mouse?

I'd love it if it had similar start functionality to the famous Mouser (keyboard control of the mouse) script, as in CTRL+M begins activity, and CTRL+M stops activity.

I figured I'd map the scroll wheel to volume, the left and right mouse buttons to previous and next, the scroll-wheel click to pause/play, and one of the two other keys (on this mouse) to mute, and the other? I have no idea.

I've already searched google and came up with nothing.

I tried recorder to record

Thanks,

Matt

Link to comment
https://www.neowin.net/forum/topic/519314-autohotkey-mouse-media-control/
Share on other sites

Very very simple.

Anyone know how I can capture left mouse down, right mouse clicked, left mouse up?

msgbox, Media Mouse Enabled.  CTRL+m to exit.


WheelUp::
Send {Volume_Up}
return

WheelDown::
Send {Volume_Down}
return

MButton::
Send {Media_Play_Pause}
return

LButton::
Send {Media_Prev}
return

RButton::
Send {Media_Next}
return


^m::ExitApp

  • 3 weeks later...

It's a Christmas miracle.

Do you still have the source?

Nice name choice.

I started getting crazy, and my script also fails to work because I got to crazy. I kinda stopped working on it, but, I figured I'd rather not have the splash be present when dealing with WMP, just winamp.

Regardless... I think I can do this whole thing by taking the window classes into account, then targetting the window and sending the internal hotkey.

Anyway, Thanks manj!

Sure,.. here's the source:

#NoTrayIcon
#KeyHistory 0
CoordMode, ToolTip, Screen
CoordMode, Mouse, Screen
SetFormat, Float, 0.0 
SetTimer, SplashOff, 1000 
SoundGet, CurrSnd1 

#LButton:: 
SendInput, {Blind}{Media_Play_Pause}
Return

#RButton:: 
SendInput, {Blind}{Media_Stop}
Return

#MButton:: 
SendInput, {Blind}{Volume_Mute}
Return

#XButton1::
SendInput, {Blind}{Media_Prev}
Return

#XButton2::
SendInput, {Blind}{Media_Next}
Return

#WheelUp::
   GoSub, VolUp 
Return

#WheelDown::
   GoSub, VolDn 
Return

*Volume_Up::
   GoSub, VolUp 
Return

*Volume_Down::
   GoSub, VolDn 
Return

VolUp: 
   #MaxHotkeysPerInterval 50 
   SoundSet, +10		
   SoundGet, CurrSnd 
   GoSub, Display 
Return

VolDn: 
   #MaxHotkeysPerInterval 50 
   SoundSet, -10		
   SoundGet, CurrSnd
   GoSub, Display 
Return

Display: 
   MouseGetPos, PosX, PosY,,,
   EnvAdd, PosX, 25
   ToolTip, Volume %CurrSnd%`%, %PosX%, %PosY%
   CurrSnd1 = %CurrSnd% 
   SetEnv, PressTime, %A_MDay%%A_Hour%%A_Min%%A_Sec% 
   EnvAdd, PressTime, 1 
   SetTimer, SplashOff, On 
Return

SplashOff: 
  SetEnv, PressTime2, %A_MDay%%A_Hour%%A_Min%%A_Sec% 
  IfGreaterOrEqual, PressTime2, %PressTime% 
  { 
	ToolTip 
	SetTimer, SplashOff, Off 
  } 
Return

Without volume splash:

#NoTrayIcon
#KeyHistory 0

#LButton:: 
SendInput, {Blind}{Media_Play_Pause}
Return

#RButton:: 
SendInput, {Blind}{Media_Stop}
Return

#MButton:: 
SendInput, {Blind}{Volume_Mute}
Return

#WheelUp::
SendInput, {Blind}{Volume_Up}
Return

#WheelDown::
SendInput, {Blind}{Volume_Down}
Return

#XButton1::
SendInput, {Blind}{Media_Prev}
Return

#XButton2::
SendInput, {Blind}{Media_Next}
Return

If you want to use it with Winamp just paste these lines in the [gen_hotkeys] section in Winamp.ini

nbkeys=4
version=2
enabled=1
action0=ghkdc play/pause
hotkey0=6323
action1=ghkdc stop
hotkey1=6322
action2=ghkdc prev
hotkey2=6321
action3=ghkdc next
hotkey3=6320

Edited by Herby
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.