A React widget for connecting SNEX gamepads.
When this widget exist in your application any user can control your application on with their phone by clicking the widget and going to the URL shown.
The widget will keep track of link lifetime according to what the SNEX API reports. After the link expires the widget will go back to showing the SNEX logo and a new session can be requested by clicking again.
For more information on the controller API refer to the SNEX Documentation.
Minimal Example https://codesandbox.io/s/31v55l51jm
Multiple Connections https://codesandbox.io/s/z3y221m534
yarn add @snex/react-connect
Wire up SNEX with the
onConnection property to receive remotes and listen to the
data event of remotes.
Function to call everytime a controller is connected. The function will have the connecting controller as argument. To listen for input from controller attach a listener to the
Controller type to create URL for like
genesis. Default to
nes. For a full list of controllers refer to the SNEX Documentation.