Saturday, September 22, 2012

How to get ASUS notebooks' media keys to work with Winamp/MusicBee/Etc

Let me say it clearly: ASUS I Hate you.
Ok, actually I don't hate asus. They make great products. I'm just ranting about the fact that they limited their notebooks' media keys to work only with, say, Windows Media Player or Media Center.

I was a big Winamp user (I recently switched to MusicBee) and I was desperate to find a way to make my media keys work with it so I could play Left4Dead and skip songs while playing.

After hours of googling I found the answer: http://zaak404.wordpress.com/2011/05/09/controlling-foobar2000-with-asus-g73-media-keys/
All you have to do is to replace ASUS' DMedia.exe (C:\Program Files (x86)\ASUS\ATK Package\ATK Media) with the supplied one and you are almost done. Zaak404's versione requires you to write a small configuration file to make his program interact only with one single media player... I'm lazy (and I reinstall windows frequently) so I made my own version of his program and it doesn't require any user effort.

So, kudos to zaak404 for doing all the real (read "hard") work on this code. I just edited it to make it work "globally". I'm using windows' keybd_event function, which has been around from win 3.1 I think :D It's deprecated, but it still works in windows 7 so... I don't give a fuck about it ;)

I packed the binary in a Zip file with a .bat file. To install it just right-click install.bat and run it as administrator. Now restart your PC and all should work fine. If it doesn't it probably means ASUS changed the default DMedia.exe's directory, so you have to find the new one and copy manually .\bin\Release\DMedia.exe.

If you have any other problem, just drop a comment below.

Download .ZIP
Repository@BitBucket