getmusicbee.com

MusicBee & Add-Ons => Customizations => Plugins => Topic started by: daedalus on June 11, 2011, 09:45:46 PM

Title: Alternative Mediakey Plugin
Post by: daedalus on June 11, 2011, 09:45:46 PM
Description
As we all know some keyboard drivers like IntelliType don't play well with (global) media keys. I mainly created this plugin for my own use but decided to share it with everyone here. I have also included the source code for people to look at (and improve upon if they wish). The actual alternative method is to use low-level hooks instead of normal shell hooks to intercept the media keys before IntelliType (or other similar ones).

Known bugs
If MusicBee is stuck doing something (as in hard-locked) your keyboard keys may become unresponsive for about 10 seconds. (I tried to work around this problem by having the actual calls to MB asynchronous but apparently it stalls somewhere else).
Under normal conditions this should never happen.

How to use
1. Disable all media hotkeys from your keyboard settings
2. Disable all media keys from MusicBee Preferences -> Hotkeys
3. Extract the DLL to MusicBee\Plugins
4. Enable the plugin from MusicBee Preferences -> Plugins

Disclaimer
I created this completely as a for-fun project and started without knowing much about Windows APIs at all and cannot really guarantee this code is the most optimal one or runs correctly on your computer. That said I have been running this for a month without any problems.

Download
[.NET2] for MusicBee 1.4
Binary (most people want this): http://daedalus.pingtimeout.net/rls/mb_alt_mediakeys/mb_alt_mediakeys_bin.zip
[.NET4] for MusicBee 2
http://www.mediafire.com/?ju8rbwpdy5pnc64

Source: http://daedalus.pingtimeout.net/rls/mb_alt_mediakeys/mb_alt_mediakeys_src.zip

If you find any bugs feel free to report them. I will try to fix them myself if I can but I would prefer you suggest a fix yourself if you can :)

edit:
added .NET4 build
Title: Re: Alternative Mediakey Plugin
Post by: eronel on September 26, 2011, 10:53:56 PM
Hi,

thank you very much for your great plugin! Being able to use mediakeys in fullscreen applications was the one thing I was missing in musicbee. Your plugin did the trick. So thanks again...
Title: Re: Alternative Mediakey Plugin
Post by: Joergermeister on October 04, 2011, 10:47:39 PM
Great stuff! Works like a charme for me. Fantanstic to use the keyboard shortcuts from the MS Digital Media Keyboard 3000, allthough MusicBee does not have the focus or full window. Love it!
Title: Re: Alternative Mediakey Plugin
Post by: Steven on November 27, 2011, 09:35:55 PM
this functionality is now built into musicbee 1.4

in the end i couldnt get the keyboard handling to work correctly so i have taken the functionality out of musicbee (from 1.4.4363) and anyone who cant get mediakeys working natively in musicbee should use this plugin
Title: Re: Alternative Mediakey Plugin
Post by: paq on December 21, 2011, 12:06:02 AM
I have a Microsoft Wireless Keyboard 3000 with media buttons and together with MusicBee version 1.4.4370 and this plugin I have one issue:

When the player has focus and I press the Play/Pauise button MusicBee will immediately pause the music and then start playing it again (or play the music directly followed by a pause if the music was already paused). It behaves like a "double click". When the player has no focus it works fine.

However, if I use the previous version of MusicBee, 1.4.4362 and have this plugin enabled the "double click" behavior is gone. If I remember correctly this also applied to other versions where handling of media keys were built in but not to all of them.

So, now that the handling of media keys is no longer built in I'm back to having the Play/Pause button repeating itself when the player has focus.
Title: Re: Alternative Mediakey Plugin
Post by: Steven on December 21, 2011, 07:56:37 AM
try deleting the hotkey key assignment for Multimedia: Play/ Pause
Title: Re: Alternative Mediakey Plugin
Post by: paq on December 21, 2011, 05:28:45 PM
try deleting the hotkey key assignment for Multimedia: Play/ Pause

None of the Multimedia actions have any hotkeys assigned to them.  MusicBee will not register the media buttons of my keyboard, doesn't matter if the plugin is enabled or not, unless I force quit Microsoft's itype.exe.

With the plugin disabled the media buttons work fine, but they don't register globally. I have also noticed that if any other window within MusicBee has focus, for instance the Lyrics window or Preferences, the "double click" behavior is gone but as soon the main window has focus the problem is back.
Title: Re: Alternative Mediakey Plugin
Post by: Steven on December 21, 2011, 06:52:53 PM
could you try this version - as long as the mediakeys are not assigned, it should do no processing in MB and only in the mediakey plugin
http://www.mediafire.com/?4x06h6lju3cryfz

Title: Re: Alternative Mediakey Plugin
Post by: paq on December 21, 2011, 11:17:30 PM
could you try this version - as long as the mediakeys are not assigned, it should do no processing in MB and only in the mediakey plugin
http://www.mediafire.com/?4x06h6lju3cryfz

Tried it and now the problem is gone! :D With the plugin disabled, nothing happens when I click the media buttons and with the plugin enabled everything works fine - both globally and when MusicBee have focus.  Just like I believe it's supposed to be.

Thank you very much and have a merry christmas! *<:)
Title: Re: Alternative Mediakey Plugin
Post by: Borgfoot on December 31, 2011, 02:16:52 PM
Are the links in the first post dead?  I can't get them to work...
Title: Re: Alternative Mediakey Plugin
Post by: Steven on December 31, 2011, 04:43:58 PM
daedalus  sent me the source code, so i have compiled it but i cant verify that this will work:

http://www.mediafire.com/?57brg81dct55cfb

otherwise hopefully he will be able to provide another link
Title: Re: Alternative Mediakey Plugin
Post by: VX on December 31, 2011, 05:41:04 PM
daedalus  sent me the source code, so i have compiled it but i cant verify that this will work:

http://www.mediafire.com/?57brg81dct55cfb

otherwise hopefully he will be able to provide another link

Maybe the functionality provided with this plugin (when it's confirmed that it works) could be merged into MusicBee with daedalus permission ???
Title: Re: Alternative Mediakey Plugin
Post by: Borgfoot on January 01, 2012, 08:01:02 AM
Steven, I placed your compiled .dll in the musicbee/plugin folder and it shows up in the preferences > plugin menu, but when I push "configure" I just get a info screen with "OK" button.  I assume that's not normal?


(http://i.imgur.com/1L8GS.jpg)
Title: Re: Alternative Mediakey Plugin
Post by: Steven on January 01, 2012, 09:16:13 AM
yes thats normal. Does pressing a media key now activate the appropriate function in MB?
Title: Re: Alternative Mediakey Plugin
Post by: Borgfoot on January 01, 2012, 09:50:11 AM
Oh, actually my media keys worked fine before.  I had searched about configuring windows media center remotes with musicbee and some threads said to use this plugin.  Thats why I was looking into it, but I guess its just on/off with no configuration options? 

Some of my remotes buttons work, like play/pause/stop.  I was just trying to see if I could get some of the other buttons working like rewind/ff etc.
Title: Re: Alternative Mediakey Plugin
Post by: daedalus on January 06, 2012, 12:07:34 PM
Are the links in the first post dead?  I can't get them to work...
The server was down for few days so the links were broken for a bit. Should work now, though :)
Title: Re: Alternative Mediakey Plugin
Post by: tcman50 on January 27, 2012, 01:06:10 AM
Downloaded, put .dll file in plugins folder, works perfect. I can now control musicbee with all the keys on my multimedia keyboard.  :)
Title: Re: Alternative Mediakey Plugin
Post by: Steven on March 03, 2012, 12:44:05 PM
added a .NET4 build for MusicBee v2
Title: Re: Alternative Mediakey Plugin
Post by: garryggreen on March 22, 2012, 05:38:41 PM
This has worked for me with one exception.  When I'm in FileBoss application (an file manager type app), the MUTE key (only) on my MM keyboard (MS Wirelss Natural MM KB w/o Intellitype s/w installed) doesn't work.  All other keys work and all keys work (it seems) if any other app has focus.

Any ideas?
Title: Re: Alternative Mediakey Plugin
Post by: daedalus on March 28, 2012, 08:56:58 AM
This has worked for me with one exception.  When I'm in FileBoss application (an file manager type app), the MUTE key (only) on my MM keyboard (MS Wirelss Natural MM KB w/o Intellitype s/w installed) doesn't work.  All other keys work and all keys work (it seems) if any other app has focus.

Any ideas?

The plugin should not affect the mute button at all, only playpause/prev/next :)
Title: Re: Alternative Mediakey Plugin
Post by: hardo on March 29, 2012, 12:45:07 PM
The volume controls for version 2 don't work. I've tried uninstalling intellitype and my keyboard, as well as the plugin. Heeeeeeeelp......

OK, sorted!
I uninstalled MB, and did a clean install of version 2 with net4 mediakeys plugin for my microsoft keyboard. All is working now. Strange one.
Title: Re: Alternative Mediakey Plugin
Post by: garryggreen on May 26, 2012, 06:15:50 AM
Can the mute key be added to the plugin?
Title: Re: Alternative Mediakey Plugin
Post by: Gytax on August 05, 2012, 12:13:35 AM
Using the .NET 4 version with Musicbee 2.0.4586 and a Logitech Illuminated keyboard with Setpoint 6.32.7
It doesn't seem to to anything.

At a certain point, the play/pause button worked..once. Couldn't figure out why. But it stopped working a few seconds later.

EDIT:
I just found out, it seems to only work when I select the media-key option in Setpoint and keep Setpoint in the foreground..
Whenever I switch to Musicbee, the keys stop working.
I then need to switch to Setpoint again, select a random option in the list and then select the media-key option again and the keys start working.
Title: Re: Alternative Mediakey Plugin
Post by: DigiCowboy on September 01, 2012, 01:26:48 AM
Just registered to say THANKS! Microsoft Wireless keyboard now working.
Title: Re: Alternative Mediakey Plugin
Post by: Steven on September 01, 2012, 08:24:13 AM
just FYI, i now know what the problem is with the MusicBee keyboard handling but its too late in this release to make the change so i will do it for MusicBee 2.1
Title: Re: Alternative Mediakey Plugin
Post by: zombie on September 25, 2012, 02:08:54 AM
Thanks very much for this plugin, it worked great when I encountered problems with my media keys for my Logitech G15 (gen 2)

 ;D ;D ;D
Title: Re: Alternative Mediakey Plugin
Post by: BehzadSh on December 23, 2012, 11:51:36 AM
just FYI, i now know what the problem is with the MusicBee keyboard handling but its too late in this release to make the change so i will do it for MusicBee 2.1

I've upgraded to 2.1.4733 still have problem with my "Logitech MK520" multimedia key (with or without this plugin)
Title: Who can help please?
Post by: Thomas320d on December 29, 2012, 12:03:42 AM
Hello everyone,

I can't get this plugin working with my logitech K350 keyboard.
It will only work if I terminate the Logitech software.
And without the plugin I could only control Musicbee with the multimedia keys if the focus was in MB. When the cursor was somewhere else I could not control anything (but it worked with Mediaplayer).

I did as said in the manual but switching off the logitech software is not the point because I need it for other tasks

Any ideas?

Thomas
Title: Re: Alternative Mediakey Plugin
Post by: ufkal on February 01, 2013, 03:24:42 PM
WORKS!!! I am so thrilled, now I can focus on making this my daily (and only ) music player .  Last stop is making sure the burn options work for my needs. 

thank you for this plugin. 
Title: Re: Alternative Mediakey Plugin
Post by: demetirum on March 11, 2013, 06:27:27 PM
Hello, I installed the plugin and followed the steps, but it does not work. My keyboard is a Razer Arctosa , it has a cluster of media keys on the top right but they do not work with MusicBee, any advice on how to fix it as I really prefer MusicBee to Foobar2000.

Thanks.
Title: Re: Alternative Mediakey Plugin
Post by: skipsy on April 12, 2013, 11:50:11 PM
could you try this version - as long as the mediakeys are not assigned, it should do no processing in MB and only in the mediakey plugin
http://www.mediafire.com/?4x06h6lju3cryfz




Hi Steven,

I'm having exactly the same problem with Play/Pause and Next/Last Track - it seems the button operation is happening twice each time I press. I tried to download the other plugin version you suggested might fix this but it's apparently no longer available. Can you give me a link to download it?

Thanks.
Title: Re: Who can help please?
Post by: Nazgulled on June 14, 2013, 01:13:25 AM
Hello everyone,

I can't get this plugin working with my logitech K350 keyboard.
It will only work if I terminate the Logitech software.
And without the plugin I could only control Musicbee with the multimedia keys if the focus was in MB. When the cursor was somewhere else I could not control anything (but it worked with Mediaplayer).

I did as said in the manual but switching off the logitech software is not the point because I need it for other tasks

Any ideas?

Thomas

I have the same issue... Disabling the Logitech SetPoint software leaves the media keys working (I'm using the plugin on this thread) but I need the software to be running for other features, can't disable it. How can we make the media keys on our Logitech keyboards work properly?
Title: Re: Alternative Mediakey Plugin
Post by: boroda on June 26, 2013, 07:58:52 AM
Here is plugin's wiki page (http://musicbee.wikia.com/wiki/Alternative_Mediakey_Plugin). Please update it if plugin is updated.
Title: Re: Alternative Mediakey Plugin
Post by: Akumasama on November 26, 2013, 09:10:35 PM
1. Disable all media hotkeys from your keyboard settings
Can anybody help me with this? I got a Logitech G19. How do I "disable" the media keys from my keyboard settings?
Title: Re: Alternative Mediakey Plugin
Post by: ImOnAUnicorn on December 18, 2013, 03:19:24 PM
I'm using a Logitech Y-BN52 and it doesnt work with SetPoint (v6.61) running in the background. I guess they just don't cohere with one another. If I exit SetPoint, everything works but you don't get to use the other features that SetPoint offers on your keyboard, which is pretty much a trade-off.

edt: also found this information from a logitech support forum

" Since MusicBee, VLC and Mediamonkey are based upon web applets (flash, java script) and are not an application like the Windows Media Player, the keys on your Logitech Wireless Combo MK520 can't be able to change parameters like prev, play/pause, next, and media information "can't be understood" by the keyboard since it is based on flash, therefore you're unable to use the media keys with these programs."

different keyboards models, same brand, and same keyboard software (SetPoint)

source: http://forums.logitech.com/t5/Keyboards-and-Keyboard-Mice/KM520-media-keys-not-working-globally/td-p/942114
Title: Re: Alternative Mediakey Plugin
Post by: ma_t14 on December 18, 2013, 08:53:19 PM
" Since MusicBee, VLC and Mediamonkey are based upon web applets (flash, java script) and are not an application like the Windows Media Player, the keys on your Logitech Wireless Combo MK520 can't be able to change parameters like prev, play/pause, next, and media information "can't be understood" by the keyboard since it is based on flash, therefore you're unable to use the media keys with these programs."

different keyboards models, same brand, and same keyboard software (SetPoint)

source: http://forums.logitech.com/t5/Keyboards-and-Keyboard-Mice/KM520-media-keys-not-working-globally/td-p/942114

What? That definitely is not accurate.  o.O

Anyway, try using an older version of setpoint. Other users here had success doing so in the past.  e.g. from here: http://www.oldapps.com/setpoint.php

Also this post here might be of some help if everything else fails: http://getmusicbee.com/forum/index.php?topic=8380.msg48551#msg48551
Title: Re: Alternative Mediakey Plugin
Post by: Steven on December 18, 2013, 08:56:39 PM
i have to admit i had a bit of a laugh when i read that
Title: Re: Alternative Mediakey Plugin
Post by: tbs on February 04, 2014, 05:13:47 PM
This plugin has a small issue, stop to work when system back from sleep. Is it possible to fix that?
Title: Re: Alternative Mediakey Plugin
Post by: YonluTheWizard on February 05, 2018, 07:37:23 PM
This plugin has a small issue, stop to work when system back from sleep. Is it possible to fix that?

I know this topic is quite literally 4 years old at this point, but i'm having the same issue. Alternative media keys plugin works great once enabled, but i have to re-enable it after each time i restart my computer. The linked wiki page for the plugin has since been deleted, saying that the functionality is now included in musicbee- but I haven't found that to be the case. I still need the plugin to use media keys when musicbee is not the focused window. If anyone sees this, please let me know if you are aware of any solutions. Further information can be provided if necessary.