Skip to content

Question : How to handle multiple devices of the same type #18

@haskins-io

Description

@haskins-io

Hi,

loving the code. I have a question about how it can be modified to handle multiple connections of the same device.

Let's say I have two USB Mice, both are made by the same manufacturer, so both have the same vendor id and product id. When a button on mouse 1 is pressed I want to print "Hello", and when a button on the other mouse is pressed I want to print "World".

The read function receives all the data from the press of a mouse button, but I can't work out how to tie this back to a device that was detected in the rawDeviceAdded function.

It there anyway of doing this?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions