MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / beginMouseButton

Method beginMouseButton

src/visualizer/input/input_router.cpp:39–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37 }
38
39 void InputRouter::beginMouseButton(const int action, const double x, const double y) {
40 if (action != ACTION_PRESS) {
41 return;
42 }
43
44 ++pressed_mouse_buttons_;
45
46 if (state_.pointer_capture == InputTarget::None) {
47 state_.pointer_capture = hoverTarget(x, y);
48 }
49
50 switch (state_.pointer_capture) {
51 case InputTarget::Gui:
52 state_.keyboard_focus = InputTarget::Gui;
53 break;
54 case InputTarget::Viewport:
55 state_.keyboard_focus = InputTarget::Viewport;
56 break;
57 case InputTarget::None:
58 if (!isViewportPoint(x, y)) {
59 state_.keyboard_focus = InputTarget::None;
60 }
61 break;
62 }
63 }
64
65 void InputRouter::endMouseButton(const int action) {
66 if (action != ACTION_RELEASE) {

Callers 2

processEventMethod · 0.80
TEST_FFunction · 0.80

Calls 1

isViewportPointFunction · 0.85

Tested by 1

TEST_FFunction · 0.64