简体   繁体   中英

Verify ongamepadconnected/disconnected supported by looking for the GamepadEvent Existence

So I just realized that the ongamepadconnected event returns a GamepadEvent object

Is it a good idea to just check for this object when trying to see if ongamepadconnected/disconnected is supported on the user's browser?

This way I, or any other developer can check if this event exists and act accordingly.

是的, 'GamepadEvent' in window中的'GamepadEvent' in window是一个可行的功能测试。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM