Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use-mid-button-wasd #1450

Merged
merged 2 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ui/zenoedit/viewport/cameracontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ void CameraControl::fakeMousePressEvent(QMouseEvent *event)
{
ZASSERT_EXIT(m_zenovis);
auto scene = m_zenovis->getSession()->get_scene();
if (event->buttons() == Qt::RightButton) {
right_button_pressed = true;
if (event->button() == Qt::MiddleButton) {
middle_button_pressed = true;
}
if (scene->camera->m_need_sync) {
scene->camera->m_need_sync = false;
Expand Down Expand Up @@ -483,8 +483,8 @@ QVariant CameraControl::hitOnFloor(float x, float y) const {
}

void CameraControl::fakeMouseReleaseEvent(QMouseEvent *event) {
if (event->buttons() == Qt::RightButton) {
right_button_pressed = false;
if (event->button() == Qt::MiddleButton) {
middle_button_pressed = false;
}
if (event->button() == Qt::LeftButton) {

Expand Down Expand Up @@ -637,7 +637,7 @@ void CameraControl::fakeMouseReleaseEvent(QMouseEvent *event) {
}

bool CameraControl::fakeKeyPressEvent(int uKey) {
if (!right_button_pressed) {
if (!middle_button_pressed) {
return false;
}
float cos_t = cos(getTheta());
Expand Down
2 changes: 1 addition & 1 deletion ui/zenoedit/viewport/cameracontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class CameraControl : public QObject
std::shared_ptr<zeno::FakeTransformer> m_transformer;
Zenovis* m_zenovis;

bool right_button_pressed = false;
bool middle_button_pressed = false;
};


Expand Down