-
Notifications
You must be signed in to change notification settings - Fork 16
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
Conversation
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>
There was a problem hiding this 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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks for review!
ctlra/devices/3dconnexion.c
Outdated
uint8_t *buf = data; | ||
|
||
switch(size) { | ||
case 7: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic numbers?
There was a problem hiding this comment.
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>
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:
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