In our code, we basically use this code to set up the Spacemouse device:
Code: Select all
SiInitialize(); SiOpenData oData; SiOpenWinInit(&oData, m_hwnd); SiSetUiMode(SI_ALL_HANDLES, SI_UI_NO_CONTROLS); m_siHdlDevice = SiOpen("OurApp", SI_ANY_DEVICE, SI_NO_MASK, SI_EVENT, &oData); SiSyncAxesState axesState; axesState.state = SI_SYNC_AXES_STATE_TX | SI_SYNC_AXES_STATE_TY | SI_SYNC_AXES_STATE_TZ | SI_SYNC_AXES_STATE_RX | SI_SYNC_AXES_STATE_RY | SI_SYNC_AXES_STATE_RZ; SiSyncSetAxesState(m_siHdlDevice, axesState);
- Open Sketchup. Spacemouse is usable in SketchUp
- Open our RenderWindow. Spacemouse is usable in our Plugin.
- Focus Sketchup. Spacemouse doesn't work anymore in SketchUp.
- Focus our RenderWindow. Spacemouse is still usable.
We're going to ask the SketchUp team to maybe share the code they're using with us,
in the meantime, do you have any additional tips on how to improve the implementation?