Reputation: 98886
I have an ASUS laptop (F50SF) and I was playing around in C++ trying to intercept the multimedia keys (next track, previous track, play/pause, etc.), but I cannot figure out exactly how to do this. I tried GetAsyncKeyState(VK_MEDIA_NEXT_TRACK)
but to no avail.
I know it is possible (and that the keys are working in the first place) because these keys work fine in Windows Media Player.
Any ideas?
Upvotes: 4
Views: 5654
Reputation: 585
The problem is the ATK Media utility provided by Asus is completely locked and instead of emiting keyboard events (like normal media keys), it maps them to specific apps. The order and name of apps that it looks for change depending on version and system, but luckily there's a fix!
I just came across the solution for this after some time reading a bunch of sites.
Download the rar package from this blog post: http://3mptylab.blogspot.it/2012/09/how-to-make-asus-notebooks-media-keys.html
Stop the current DMedia.exe process.
Go to your ATK Media install folder (normally C:\Program Files (x86)\ASUS\ATK Package\ATK Media) and rename DMedia.exe to DMedia.exe.old (just to be safe).
Put DMedia.exe you'll find in the RAR into the ATK Media dir. Double click it to run it but it gets run at boot anyway.
Check if the media keys work as they should. Grab a beer or watch a movie if it works!
I just tested it in my Asus U30Jc under Win8 Pro 64-bits and works great! This tool actually maps generic keyboard events to the media keys in the integrated keyboard, so they work with any app enabled for this (in some cases like Winamp you might need to enable global keys).
Upvotes: 11
Reputation: 49527
Some laptops (like my Asus M51Sn) don't generate key presses for special (multimedia) keys. I believe those keys generate ACPI events instead. I have no idea about how to catch those. :-\
If you want to see what I've already tested, take a look at my question at SuperUser.
Upvotes: 1
Reputation:
I found this gem over at autohotkey http://www.autohotkey.com/forum/viewtopic.php?p=302923 it helped me map net, mail, P1 and P2 buttons on my notebook which would otherwise require some bloatware media center software to remap them. it isn't C++ but it could help you get in the right direction by looking up scan codes!
Upvotes: 2