Skip to content

Commit

Permalink
Add info for Mac OS X (M1) instalation, close #10, upgrade version
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubAndrysek committed Oct 21, 2023
1 parent be1eb2f commit 24f2e95
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,28 @@ pip install pyspacemouse
the [hidapi releases](https://github.com/libusb/hidapi/releases) page.
- Set system environment: add absolute path for `x64` or `x86` folder in Path.

- ### Mac OS X
- ### Mac OS X (M1)
- Install from [Homebrew](https://formulae.brew.sh/formula/hidapi)
- `brew install hidapi`
- Add hidapi to your `DYLD_LIBRARY_PATH` directory.
```bash
export DYLD_LIBRARY_PATH=/opt/homebrew/Cellar/hidapi/0.14.0/lib:$DYLD_LIBRARY_PATH
```
- On MacOS M1 you will need patched version of easyhid
```bash
pip install git+https://github.com/bglopez/python-easyhid.git
```
- In case of problem with M1 chip, try to run you code with Rosseta 2
- How to use Rosseta 2 - [Setup Rosetta](https://apple.stackexchange.com/questions/428768/on-apple-m1-with-rosetta-how-to-open-entire-terminal-iterm-in-x86-64-architec)
- Tested and developed by [consi](https://github.com/JakubAndrysek/PySpaceMouse/issues/10#issuecomment-1768362007) - thanks!

- [easyhid](https://github.com/bglopez/python-easyhid) is `hidapi` interface for Python - required on all platforms
- `pip install git+https://github.com/bglopez/python-easyhid.git`
- this fork fix problems with `hidapi` on MacOS.
- on other platforms it possible works with original package `pip install easyhid`

## Basic Usage:
[basicExample.py](examples/basicExample.py)
[basicExample.py](https://github.com/JakubAndrysek/PySpaceMouse/blob/master/examples/basicExample.py)
````py
import pyspacemouse
import time
Expand All @@ -91,15 +102,15 @@ if success:

## State objects

State objects returned from read() have 7 attributes: [t,x,y,z,roll,pitch,yaw,button].
State objects returned from `read()` have 7 attributes: [t,x,y,z,roll,pitch,yaw,button].
* t: timestamp in seconds since the script started.
* x,y,z: translations in the range [-1.0, 1.0]
* roll, pitch, yaw: rotations in the range [-1.0, 1.0].
* button: list of button states (0 or 1), in order specified in the device specifier
## Usage with callback
[callbackExample.py](examples/callbackExample.py)
[callbackExample.py](https://github.com/JakubAndrysek/PySpaceMouse/blob/master/examples/callbackExample.py)
````py
import pyspacemouse
import time
Expand Down
19 changes: 15 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,28 @@ pip install pyspacemouse
the [hidapi releases](https://github.com/libusb/hidapi/releases) page.
- Set system environment: add absolute path for `x64` or `x86` folder in Path.

- ### Mac OS X
- ### Mac OS X (M1)
- Install from [Homebrew](https://formulae.brew.sh/formula/hidapi)
- `brew install hidapi`
- Add hidapi to your `DYLD_LIBRARY_PATH` directory.
```bash
export DYLD_LIBRARY_PATH=/opt/homebrew/Cellar/hidapi/0.14.0/lib:$DYLD_LIBRARY_PATH
```
- On MacOS M1 you will need patched version of easyhid
```bash
pip install git+https://github.com/bglopez/python-easyhid.git
```
- In case of problem with M1 chip, try to run you code with Rosseta 2
- How to use Rosseta 2 - [Setup Rosetta](https://apple.stackexchange.com/questions/428768/on-apple-m1-with-rosetta-how-to-open-entire-terminal-iterm-in-x86-64-architec)
- Tested and developed by [consi](https://github.com/JakubAndrysek/PySpaceMouse/issues/10#issuecomment-1768362007) - thanks!

- [easyhid](https://github.com/bglopez/python-easyhid) is `hidapi` interface for Python - required on all platforms
- `pip install git+https://github.com/bglopez/python-easyhid.git`
- this fork fix problems with `hidapi` on MacOS.
- on other platforms it possible works with original package `pip install easyhid`

## Basic Usage:
[basicExample.py](examples/basicExample.py)
[basicExample.py](https://github.com/JakubAndrysek/PySpaceMouse/blob/master/examples/basicExample.py)
````py
import pyspacemouse
import time
Expand All @@ -91,15 +102,15 @@ if success:

## State objects

State objects returned from read() have 7 attributes: [t,x,y,z,roll,pitch,yaw,button].
State objects returned from `read()` have 7 attributes: [t,x,y,z,roll,pitch,yaw,button].
* t: timestamp in seconds since the script started.
* x,y,z: translations in the range [-1.0, 1.0]
* roll, pitch, yaw: rotations in the range [-1.0, 1.0].
* button: list of button states (0 or 1), in order specified in the device specifier
## Usage with callback
[callbackExample.py](examples/callbackExample.py)
[callbackExample.py](https://github.com/JakubAndrysek/PySpaceMouse/blob/master/examples/callbackExample.py)
````py
import pyspacemouse
import time
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setuptools.setup(
name='pyspacemouse',
version='1.0.9',
version='1.1.0',
author='Jakub Andrýsek',
author_email='[email protected]',
description='Multiplatform Python interface to the 3DConnexion Space Mouse - forked from pyspacenavigator',
Expand Down

0 comments on commit 24f2e95

Please sign in to comment.