Skip to content

Commit

Permalink
Merge pull request #1450 from zenustech/use-mid-button-wasd
Browse files Browse the repository at this point in the history
use-mid-button-wasd
  • Loading branch information
legobadman authored Sep 28, 2023
2 parents 911498e + b9fa237 commit 9596d2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
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

0 comments on commit 9596d2b

Please sign in to comment.