Skip to content

support symlink paths #38

@v4hn

Description

@v4hn

Just like others using this project over spacenavd, I have multiple spacemice that I need to integrate on the same system.

I found the path parameter in open, which says:

path: path of the device to open. If path is specified it will try to open at that path regardless of what is connected to it

So I thought I would use udev to create symlinks for the specific devices for stability and set path to the named reference (KERNELS for port identification because the USB serials of the devices are not unique...):

SUBSYSTEM=="hidraw", ATTRS{idVendor}=="256f", ATTRS{idProduct}=="c635", KERNELS="1-2", MODE="0666", SYMLINK+="spacemouse_left"

But pyspacemouse.open(path="/dev/spacemouse_left") fails because it uses easyhid which only lists the canonical path /dev/hidraw*. Note that /dev/spacemouse_left is a symlink to such a canonical path.

Are you open to add support for this use to pyspacemouse?
I'm open to contribute a patch, but I would appreciate some initial feedback on whether/how you would like to support it.

EDIT: A colleague noticed that path does seem to work as intended, as long as device is also specified. That partly solves the problem, but I would still like to avoid the redundant parameter as it can be inferred.

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