Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3dconnexion: SpaceMouse Pro support added #44

Merged
merged 2 commits into from
Oct 19, 2017
Merged

3dconnexion: SpaceMouse Pro support added #44

merged 2 commits into from
Oct 19, 2017

Conversation

harryhaaren
Copy link
Member

This commit adds support to Ctlra for the SpaceMouse Pro.
The wireless version of the device was used for testing,
although it is expected to be similar to the wired version.

All input buttons are mapped to Ctlra events, and the 6-dof
knob controller is mapped to 12 sliders as follows:

  • Move Left
  • Move Right
  • Move Forward
  • Move Backward
  • Move Up
  • Move Down
  • Rotate Anti-Clockwise
  • Rotate Clockwise
  • Rotate Left
  • Rotate Right
  • Rotate Backward
  • Rotate Forward.

Combining two axis back into a single -1..1 range value is trivial
in the application, if the application wants to use that range.

Signed-off-by: Harry van Haaren harryhaaren@gmail.com

This commit adds support to Ctlra for the SpaceMouse Pro.
The wireless version of the device was used for testing,
although it is expected to be similar to the wired version.

All input buttons are mapped to Ctlra events, and the 6-dof
knob controller is mapped to 12 sliders as follows:
- Move Left
- Move Right
- Move Forward
- Move Backward
- Move Up
- Move Down
- Rotate Anti-Clockwise
- Rotate Clockwise
- Rotate Left
- Rotate Right
- Rotate Backward
- Rotate Forward.

Combining two axis back into a single -1..1 range value is trivial
in the application, if the application wants to use that range.

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
Copy link
Contributor

@foolswood foolswood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a neat controller idea (not one I have on hand to test sadly).

(void)future;
struct spacemouse_t *dev = calloc(1, sizeof(struct spacemouse_t));
if(!dev)
goto fail;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only goto fail, but there are 3 instances of the code of fail in this function.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks for review!

uint8_t *buf = data;

switch(size) {
case 7:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magic numbers?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with #defines

Thanks for the review!

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
@harryhaaren harryhaaren merged commit 8ddb4ec into master Oct 19, 2017
@harryhaaren harryhaaren deleted the spacemouse branch October 19, 2017 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants