I'm trying to do the following: Send to MusicBee the combination Ctrl+N (Next Track) whatever the application is currently active, by using AltGr+N key.
I've tried the following:
<^>!N::
if WinExist("ahk_exe MusicBee.exe")
ControlSend, ahk_parent, ^n ; Send the keys to the last found window (found by WinExist)
which is supposed to work. The idea is to be able to circle through next tracks by keeping AltGr pressed, and pressing N multiple times. Means that I don't want to have to release AltGr key for the instruction to be sent to MusicBee.
Issue is the following: When keeping AltGr pressed, the first time I press N, nothing will happen (I go through the shortcut (if I add a MfgBox, I see that I go through the code, but nothing happens. When I press N a second time, it will work. When I say nothing happens at the first time, this is not exact : this will lock my Left Control key to down state. So if I'm for example in Notepad, I press AltGr+N (nothing happens in MusicBee), but then if I press just "O", the panel to open a file is displayed (as if Ctrl+O was pressed).
Then I've also tried:
ControlSend, ahk_parent, ^n{LCtrl up}
or
ControlSend, ahk_parent, {LCtrl down}n{LCtrl up}
but without success.
I've also played a bit with:
KeyWait N ; wait the N key to be released
and
SetKeyDelay 10,10
but with no more success.
Do you have an idea how to avoid that the first combination to get AltGr will result in blocking LCtrl down ?