Using AsyncKeydown

I’m having a bit of trouble getting my left/right arrow keys to control the rewind/fast forward of my movieplayer control (using MBS QT plugin). While I have the movie playing when I hit the CONTROL+SPACEBAR, if I just use the left and right arrow keys (without CONTROL) it will not do the FFWD or REW unless I first click on the MoviePlayer control. I tried adding a MoviePlayer1.setFocus when the arrow keys are pressed, but it doesn’t seem to help. I also can’t seem to get the arrow keys to work the same way I have the Play working (using CONTROL). Here is my code…

[code] if Keyboard.AsyncControlKey then
if Key = Chr(32) then // Control+Spacebar toggles play/pause
if moviePlaying = true then
Movieplayer1.Stop
moviePlaying = false
else
MoviePlayer1.Play
moviePlaying = true
end if
end if

If Keyboard.AsyncKeyDown(&h7B) then
//left arrow key does REWIND
MoviePlayer1.setFocus
MoviePlayer1.Play
MoviePlayer1.Movie.rateMBS=-65536
end if

If Keyboard.AsyncKeyDown(&h7C) then
//right arrow key does FFWD
MoviePlayer1.setFocus
MoviePlayer1.Play
MoviePlayer1.Movie.RateMBS=2.0 * 65536
end if
[/code]

So if using the Control key with the left/right arrow buttons will allow it to work even if the MoviePlayer is not in focus, then I’d rather do that instead of just the arrow keys on their own, but I can’t seem to get the right code as I did with the spacebar.

There’s a reply from another question: that may work for you.

Where is the code you posted ?

QT Plugin?
Is this still Real Studio 2012?

I did not notice the OP was from 2014. Since then, I hope the guy has found a solution :smiley: