MoviePlayer disable keys

I’m running version 2016 Release 3
Im using a MoviePlayer control which loads and plays different short movies randomly.
Movieplayer PlayerType is set on Quicktime (though it doesn’t seem to make much difference setting it to Preferred Player)
Iv’e noticed that I can reverse the playing movie by pressing the “o” key on my keyboard or stop the movie and move it one frame at a time by pressing either the left or right arrow keys.
How can I disable these keys to the user while playing the movie(s)?
Iv’e tried taking the focus away from the MoviePlayer control but keys still seem to work?

Return true in KeyDown?

Sorry Tim - Don’t know what you mean

Strange, As far I know there should be no trace of QuickTime in Xojo Mac since 2014, as Apple banned it from the Mac App Store. And seeing “Windows Media Player” in a Mac project somehow looks out of place.

At any rate, here is a solution : cover the Mediaplayer with a Canvas, add to it the MouseDown event, end inside just put

Return True

You can play on the canvas Visible property to access or not the buttons.

Why would you have to cover the MoviePlayer with a canvas? MoviePlayer has a KeyDown.

Indeed. But it does not stop the player from receiving keyboard keys. Neither do a canvas, though :frowning:

I have no other suggestion. Sorry.

I have an app using the QuickTime version of MoviePlayer (compiled in older Xojo) and there I use the Windows KeyDown event to filter and repurpose keys. Because nothing in the Window gets focus this works.

But using the current Xojo and AV MoviePlayer this doesn’t work, neither MoviePlayer.KeyDown or Window.KeyDown fire when pressing “o” or the arrow keys. In fact I could never get MoviePlayer.KeyDown to fire.

What does work is to put something on the Window that gets focus, like a TextField above the Windows titlebar. Put “return true” in TextField1.KeyDown and make sure it has focus.

Thanks Will - that worked great :slight_smile: