I've bought a new remote control and am using AHK to rebind some of its buttons. It doesn't have a software to set what each button will do, "it just works". Using KeypressOSD.ahk I'm able to see what keystroke it's sending.

So, it has a button that sends Win+Alt+Enter so that Windows Media Center opens. I want to prevent this shortcut from opening Windows Media Center, and make it focus Media Player Classic. This code works fine, it verifies if Media Player Classic is opened and if so it gets focus and receives a Space command:

^F1::
IfWinExist, Media Player Classic
{
  WinActivate
  Send {Space}
}
Return

I want to use the same command. But this one doesn't work, WCE still opens:

~!#Enter::
IfWinExist, Media Player Classic
{
  WinActivate
  Send {Space}
}
Return

This one works too:

~!#F2::
IfWinExist, Media Player Classic
{
  WinActivate
  Send {Space}
}
Return

Remove ~ from the hotkey:

!#Enter::
IfWinExist, Media Player Classic
{
  WinActivate
  Send {Space}
}
Return

Meaning of ~ (emphasis added):

When the hotkey fires, its key's native function will not be blocked (hidden from the system).

So basically, you requested the AHK to pass the original hotkey further.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.