Closed DJj123dj closed 4 months ago
This "button" event is only triggered by pressing the button on the hub, if you're trying to use a button device or controller then you have to access it via the port it is connected to, e.g.
const button = await hub.waitForDeviceAtPort("LEFT");
button.on("remoteButton", event => ... );
Thanks it works! I only have one more question: I think that there is something wrong in the documentation, because there it is saying that you need to listen to the "button" event and not the "remoteButton" event.
When I connect a remoteHub to node-poweredup and I check for the button event, it doesn't work correctly. I only get the center button when pressed.
Here is my code:
I'm using MacOS Monterey on a macbook pro with intel chip. My node.js version is 16.16.0