[Solved] Media Hotkeys affecting Music Events



I am making a rhythm game.
Pressing the media hotkey stops the game’s event.
Can I lock media hotkeys?

If the media hotkey stops the music, the condition doesn’t work.

Your screenshot is showing a “Sound file” condition. Your other events above are “Music” actions. They do not interact.

In general, I would recommend you avoid using the Music event actions/conditions, and should exclusively use the Sound File conditions. Read more about it here: Audio [GDevelop wiki]

Outside of that, I’m not aware of anyway to disable keys on the keyboard, media related or not.

1 Like

I tried but it still doesn’t work.

Unfortunately, can’t really provide you any guidance, you’re not going to be able to disable keys on the keyboard as far as I know.

As a side note: Anytime you deal with sound (or music) at all you should be using the trigger once command. otherwise it won’t do anything, or it will infinitely play your sound file. This is unlikely to fix this issue for you, but it will fix other issues.

Additionally, as mentioned you really should not be using the music events.

1 Like

ok i understood :disappointed_relieved:

I’m going to turn the event into sound
Thanks for your help.

solved it! :rofl:

Media hotkey not working after change to sound event
thank you so much

1 Like