views:

356

answers:

3

Hello,

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?

A: 

There is a project in Google Code that disables (intercepts) keystrokes of certain keys specified.

It's written in C but you may learn a way to do it if you go through the code.

KillKeys

Xandy
Hmm, interesting. I'll take a look.
Cameron
+1  A: 

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!

Mr X
+1  A: 

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.

Denilson Sá
Hmm, interesting. Thanks for your answer! Unfortunately, I gave up on this long ago, but maybe it'll help someone else ;-)
Cameron