MeshLib
 
Loading...
Searching...
No Matches
MRSpaceMouseHandlerWindows.h
Go to the documentation of this file.
1#pragma once
2#ifdef _WIN32
5
6namespace MR
7{
8
9class SpaceMouseHandlerWindows : public SpaceMouseHandler, public MultiListener<PostFocusListener>
10{
11public:
12 SpaceMouseHandlerWindows();
13 ~SpaceMouseHandlerWindows() override;
14
15 bool initialize() override;
16 void handle() override;
17 void updateConnected( int jid, int event ) override;
18
19 // set state of zoom by mouse scroll (to fix scroll signal from spacemouse driver)
20 MRVIEWER_API void activateMouseScrollZoom( bool activeMouseScrollZoom );
21 // get state of zoom by mouse scroll
22 bool isMouseScrollZoomActive() { return activeMouseScrollZoom_; }
23private:
24 bool active_{ true };
25 bool initialized_{ false };
26 std::array<unsigned char, SMB_BUTTON_COUNT> buttons_{};
27 int joystickIndex_{ -1 };
28 const int* mapButtons_{ nullptr };
29 int buttonsCount_{ 0 };
30 float handleTime_{ 0.f };
31
32 std::thread updateThread_;
33 std::atomic_bool updateThreadActive_{ true };
34 std::atomic<std::array<float, 6>> axesDiff_;
35 std::array<float, 6> axesOld_{};
36
37 bool activeMouseScrollZoom_{ false };
38
39 //hotfix TODO rework
40 bool isUniversalReceiver_{ false };
41
42 virtual void postFocus_( bool focused ) override;
43
44 void updateConnected_();
45 void startUpdateThread_();
46};
47
48}
49
50#endif
Definition MRCameraOrientationPlugin.h:7