I wonder if it's possible to make a contoller for web music player. Some desktop players use hotkeys to pause/play so I don't need to open app and press pause. Can I somehow do this stuff with web player? My idea is to make a global hook and then do stuff. How can I do this?
Webapps run in a sandbox so you can't create global keyboard hooks. That requires native code (dlls, exes, etc). You can catch key events from the window object since javascript events usually bubble up to the parent but this would only be while your page is the active page. A workaround would be to create the keyboard hook as native code & then talk to it via your web app. Say your keyboard hook dll could start a web server & your page could communicate via that web server. Or implement the hook in a browser addin that sends custom events to your web app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With