Skip to content
Snippets Groups Projects
Commit b5f13198 authored by jwendt's avatar jwendt
Browse files

small refactoring to desktop navigation behavior

#463
parent 492c7a4b
No related branches found
No related tags found
1 merge request!156Feature/#463 mouse keyboard device
...@@ -75,25 +75,15 @@ void DesktopNavigationBehavior::OnMouseMove(int x, int y) { ...@@ -75,25 +75,15 @@ void DesktopNavigationBehavior::OnMouseMove(int x, int y) {
void DesktopNavigationBehavior::OnMouseButton(phx::Mouse::ButtonId id, void DesktopNavigationBehavior::OnMouseButton(phx::Mouse::ButtonId id,
phx::Mouse::ButtonEvent event) { phx::Mouse::ButtonEvent event) {
if (event == phx::Mouse::BUTTON_PRESSED) { bool value_to_set = (event == phx::Mouse::BUTTON_PRESSED);
if (id == phx::Mouse::LEFT_BUTTON) {
rotation_mode_ = true;
}
if (id == phx::Mouse::MIDDLE_BUTTON) {
strafe_mode_ = true;
}
if (id == phx::Mouse::RIGHT_BUTTON) {
translation_mode_ = true;
}
} else {
if (id == phx::Mouse::LEFT_BUTTON) { if (id == phx::Mouse::LEFT_BUTTON) {
rotation_mode_ = false; rotation_mode_ = value_to_set;
} }
if (id == phx::Mouse::MIDDLE_BUTTON) { if (id == phx::Mouse::MIDDLE_BUTTON) {
strafe_mode_ = false; strafe_mode_ = value_to_set;
} }
if (id == phx::Mouse::RIGHT_BUTTON) { if (id == phx::Mouse::RIGHT_BUTTON) {
translation_mode_ = false; translation_mode_ = value_to_set;
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment