Bluetooth headphones button event detection in javascript
问题 I am building a web app where I detect the headphones button event. I succeeded in capturing headphones button event when they are plugged in. Now I am trying to capture Bluetooth headphones next button event. Any help on this please? Code for headphone button detection. document.addEventListener('volumeupbutton', () => { //Do something here }, false); I need something similar to this. 回答1: You can use keydown and keyup events for implementing the long press functionality. // Imprementation