MCPcopy Create free account
hub / github.com/MyGUI/mygui / injectMouseMove

Method injectMouseMove

Demos/Demo_Pointers/DemoKeeper.cpp:86–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84 }
85
86 void DemoKeeper::injectMouseMove(int _absx, int _absy, int _absz)
87 {
88 if (MyGUI::Gui::getInstancePtr() == nullptr)
89 return;
90
91 // при зажатой правой вращаем сцену
92 if (mRightButtonPressed)
93 {
94 // относительное смещение
95 int rel_x = _absx - mSaveCursorX;
96 int rel_y = _absy - mSaveCursorY;
97
98 _absx = mSaveCursorX;
99 _absy = mSaveCursorY;
100
101 setMousePosition(mSaveCursorX, mSaveCursorY);
102
103 // вращаем сцену
104 updateCamera(rel_x, rel_y);
105 }
106 else
107 {
108 // ввод мыши находить вне гуя
109 if (!MyGUI::InputManager::getInstance().injectMouseMove(_absx, _absy, _absz))
110 {
111 // пикаем сцену
112 std::string_view pointer = getCursorFromScene(_absx, _absy);
113 mPointerContextManager->setPointer(pointer);
114 }
115 }
116 }
117
118 void DemoKeeper::injectMousePress(int _absx, int _absy, MyGUI::MouseButton _id)
119 {

Callers 2

InputManager.hFile · 0.45

Calls 2

getInstancePtrFunction · 0.85
setPointerMethod · 0.45

Tested by

no test coverage detected