Old 28th January 2004, 01:20   #1
Junior Member
Join Date: Jan 2004
Posts: 8
One global hotkey for seeking and changing tracks

How about allowing the use of one global hotkey both for seeking and changing tracks?

If the button is pressed and not held then the track is changed when the button is released.

If the button is held down longer than a certain time or perhaps if it's held long enough to repeat then the button seeks within the current track. In this case there is no special effect when the button is released (other than that the seeking ends).

This is a very convenient user interface that's used in a lot of hardware CD and MP3 players. Yes, on a PC you do have enough keys to have separate buttons, but I don't have enough dedicated keys... I just have "|<" and ">|" media keys (along with play, play/pause, volume up and down and mute).

Flextouch Ultra does this and I really liked it. I wouldn't recommend it though because play/pause doesn't always work, reconfiguring it for a different keyboard is hard, the author failed to respond to my e-mail, and it's shareware.
enosys is offline   Reply With Quote
Old 28th January 2004, 19:07   #2
Junior Member
Join Date: Jan 2004
Posts: 8
Actually this isn't that easy

Actually this isn't that easy. The global hotkeys plugin uses the WM_HOTKEY mechanism. Unfortunately this mechanism doesn't allow it to see hotkey releases.

You could just use a timer/timeout with an algorithm something like this:
Use a flag, initially cleared, and a timer, initially inactive. Start a timer when the appropriate WM_HOTKEY is received. If any more of the same WM_HOTKEY is received before the timer expires then set the flag and use those WM_HOTKEY messages seek. Also reset the timer, perhaps to a shorter time-out because repeats are faster than the original wait before repeating. When the timer expires if the flag is clear then change tracks.

I'm not sure if this algorithm is okay though... would the wait when you want to change the track be annoying or would it be a problem if you keep rapidly pressing the button to change tracks? I think probably. Note that there is no way to differentiate the initial press from the repeats so the initial timer interval has to be long enough to always catch the first repeat.

The only other alternative seems to be a "system hook", which I've never used. Then you get all the key messages. I find this inelegant though really it's not that bad; this is about as bad as a TSR in DOS capturing the keyboard interrupt and that's been done on 8086es without messing up performance.
enosys is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Winamp > Winamp Wishlist

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump