Hotkeys

Got an idea? Missing something? Post your feature request here.

Moderator: moderators

Hotkeys

Postby dobson » Thu Apr 16, 2009 3:25 am

Subsonic has worked so well for me and my library that I use desktop players much less than I used to. One thing I miss, though, is the ability to control my music using the keyboard instead of the mouse.

Now I realize that this is a browser based player, using the embedded flash player, and so any hotkeys controlling the music would need to interact with the browser and the flash player more than they would the subsonic server itself. Furthermore, I realize that things like a "next track" command would need implementation in subsonic before a hot key could control that functionality. but that's about where my knowledge of how this kind of thing would work ends.

Nonetheless, I was wondering if anyone had any ideas for current or future ways to control the embedded flash player, or the browser, with hotkeys or shortcuts on the keyboard. even something like pause and play...

for what it's worth, I'm using opera, and flash player 10. but if people already have keyboard shortcuts they've rigged with other browsers, or simply ideas... i'd love to hear them.
dobson
 
Posts: 46
Joined: Tue Apr 14, 2009 10:10 pm

anyone?

Postby dobson » Thu Jan 07, 2010 6:46 pm

it's been a while since I posted this, so I figured I'd just check in and see if any ideas have surfaced.

does anyone use keyboard shortcuts for any of the controls? or is everyone using their mouse to click play every time, etc...
dobson
 
Posts: 46
Joined: Tue Apr 14, 2009 10:10 pm

Postby M0NG0 » Thu Feb 04, 2010 10:00 am

I use AutoHotkey to accomplish this. AutoHotkey is a free, open-source utility for Windows that allows you to automate just about anything. You can use the AutoScriptWriter (Recorder) to get the exact mouse click positions.

Here's my script:
Code: Select all
#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.
SetTitleMatchMode 3 ; A window's title must exactly match Subsonic to be a match.

Media_Next::
WinWait, Subsonic
IfWinNotActive, Subsonic, , WinActivate, Subsonic,
WinWaitActive, Subsonic,
WinMaximize, Subsonic
MouseClick, left,  777,  780
Sleep, 100
Return

Media_Prev::
WinWait, Subsonic,
IfWinNotActive, Subsonic, , WinActivate, Subsonic,
WinWaitActive, Subsonic,
WinMaximize, Subsonic
MouseClick, left,  764,  780
Sleep, 100
Return

Media_Stop::
WinWait, Subsonic,
IfWinNotActive, Subsonic, , WinActivate, Subsonic,
WinWaitActive, Subsonic,
WinMaximize, Subsonic
MouseClick, left,  431,  780
Sleep, 100
Return

Media_Play_Pause::
WinWait, Subsonic,
IfWinNotActive, Subsonic, , WinActivate, Subsonic,
WinWaitActive, Subsonic,
WinMaximize, Subsonic
MouseClick, left,  415,  780
Return


Couple of notes:
* I used Google Chrome to create an Application Shortcut, and the window title contains only "Subsonic" (without the "quotes"). The SetTitleMatchMode 3 line forces AutoHotkey to only find and maximize windows that have a title that's exactly "Subsonic". In Internet Explorer the title is "Subsonic - Windows Internet Explorer", so if I use IE for Subsonic I'd have to change all of the "Subsonic" instances in the script to "Subsonic - Windows Internet Explorer". I had to include this because if I had the Subsonic forums open in IE and don't have SetTitleMatchMode 3 in the script, AutoHotkey would mistake the IE window (which has "Subsonic..." in the title) for the actual Subsonic window. There's probably a better way to make sure the script clicks on the correct window, but this works good enough for me.

* My display is set to a resolution of 1920 x 1024. If this script was on a computer with a different resolution (or if the browser's zoom was different) the mouse click positions would need to change. You can easily find the positions with the AutoScriptWriter (Recorder) that is installed with AutoHotkey.

* I've programmed the script to only use the previous, next, play/pause, and stop buttons on my keyboard, but some keyboards have other "extra" buttons (such as Media Launch - which could be programmed to open a browser to your Subsonic installation). AutoHotkey recognizes the following extra buttons:
Browser_Back
Browser_Forward
Browser_Refresh
Browser_Stop
Browser_Search
Browser_Favorites
Browser_Home
Volume_Mute
Volume_Down
Volume_Up
Media_Next
Media_Prev
Media_Stop
Media_Play_Pause
Launch_Mail
Launch_Media
Launch_App1
Launch_App2

* You can set any key (or combination of keys) as hotkeys. For example, if you change
Code: Select all
Media_Play_Pause::
to
Code: Select all
#n::
AutoHotkey will click on the play/pause button on the Subsonic window if you press the Windows and n buttons at the same time.

* AutoHotkey comes with a great help file that's full of examples, and there's a lot more in the forums.
M0NG0
 
Posts: 13
Joined: Thu Jul 17, 2008 5:54 am

Postby donjulien » Wed Oct 27, 2010 9:37 pm

My $0.02. I guess the answer should come from the jukebox side. Check my reply here.

The AutoHotKey hack by Mongo is quite clever, but depending on the specific position of a button isn't ideal yet.
donjulien
 
Posts: 16
Joined: Fri Oct 22, 2010 12:13 am


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 8 guests