Skip to content

modified how 3D mouse buttons work - #381

Merged
gr5 merged 7 commits into
masterfrom
3dmouse
Aug 25, 2026
Merged

modified how 3D mouse buttons work#381
gr5 merged 7 commits into
masterfrom
3dmouse

Conversation

@githubdoe

@githubdoe githubdoe commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Modified what 3D graph mouse button and wheel does. Left rotates, right pans, wheel zooms.

Closes #380

Comment thread surfacegraph.cpp Outdated
Comment thread custom3dinputhandler.h

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-tidy v21.1.8

Only 3 out of 6 clang-tidy concerns fit within this pull request's diff.

Have any feedback or feature suggestions? Share it here.

Comment thread custom3dinputhandler.cpp
mappedButtons = (mappedButtons & ~Qt::LeftButton) | Qt::RightButton;
}

QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

custom3dinputhandler.cpp:23:51: warning: [clang-diagnostic-deprecated-declarations]

'localPos' is deprecated: Use position()

   23 |     QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),
      |                                                   ^
/usr/include/x86_64-linux-gnu/qt6/QtGui/qevent.h:226:5: note: 'localPos' has been explicitly marked deprecated here
  226 |     QT_DEPRECATED_VERSION_X_6_0("Use position()")
      |     ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:326:44: note: expanded from macro 'QT_DEPRECATED_VERSION_X_6_0'
  326 | # define QT_DEPRECATED_VERSION_X_6_0(text) QT_DEPRECATED_X(text)
      |                                            ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:238:33: note: expanded from macro 'QT_DEPRECATED_X'
  238 | #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
      |                                 ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qcompilerdetection.h:956:36: note: expanded from macro 'Q_DECL_DEPRECATED_X'
  956 | #  define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
      |                                    ^

clang-tidy diagnostic

custom3dinputhandler.cpp:23:70: warning: [clang-diagnostic-deprecated-declarations]

'globalPos' is deprecated: Use globalPosition()

   23 |     QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),
      |                                                                      ^
/usr/include/x86_64-linux-gnu/qt6/QtGui/qevent.h:215:5: note: 'globalPos' has been explicitly marked deprecated here
  215 |     QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
      |     ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:326:44: note: expanded from macro 'QT_DEPRECATED_VERSION_X_6_0'
  326 | # define QT_DEPRECATED_VERSION_X_6_0(text) QT_DEPRECATED_X(text)
      |                                            ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:238:33: note: expanded from macro 'QT_DEPRECATED_X'
  238 | #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
      |                                 ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qcompilerdetection.h:956:36: note: expanded from macro 'Q_DECL_DEPRECATED_X'
  956 | #  define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
      |                                    ^

Comment thread custom3dinputhandler.cpp
mappedButtons = (mappedButtons & ~Qt::LeftButton) | Qt::RightButton;
}

QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

custom3dinputhandler.cpp:41:51: warning: [clang-diagnostic-deprecated-declarations]

'localPos' is deprecated: Use position()

   41 |     QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),
      |                                                   ^
/usr/include/x86_64-linux-gnu/qt6/QtGui/qevent.h:226:5: note: 'localPos' has been explicitly marked deprecated here
  226 |     QT_DEPRECATED_VERSION_X_6_0("Use position()")
      |     ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:326:44: note: expanded from macro 'QT_DEPRECATED_VERSION_X_6_0'
  326 | # define QT_DEPRECATED_VERSION_X_6_0(text) QT_DEPRECATED_X(text)
      |                                            ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:238:33: note: expanded from macro 'QT_DEPRECATED_X'
  238 | #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
      |                                 ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qcompilerdetection.h:956:36: note: expanded from macro 'Q_DECL_DEPRECATED_X'
  956 | #  define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
      |                                    ^

clang-tidy diagnostic

custom3dinputhandler.cpp:41:70: warning: [clang-diagnostic-deprecated-declarations]

'globalPos' is deprecated: Use globalPosition()

   41 |     QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),
      |                                                                      ^
/usr/include/x86_64-linux-gnu/qt6/QtGui/qevent.h:215:5: note: 'globalPos' has been explicitly marked deprecated here
  215 |     QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
      |     ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:326:44: note: expanded from macro 'QT_DEPRECATED_VERSION_X_6_0'
  326 | # define QT_DEPRECATED_VERSION_X_6_0(text) QT_DEPRECATED_X(text)
      |                                            ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:238:33: note: expanded from macro 'QT_DEPRECATED_X'
  238 | #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
      |                                 ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qcompilerdetection.h:956:36: note: expanded from macro 'Q_DECL_DEPRECATED_X'
  956 | #  define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
      |                                    ^

Comment thread custom3dinputhandler.cpp
mappedButtons = (mappedButtons & ~Qt::LeftButton) | Qt::RightButton;
}

QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

custom3dinputhandler.cpp:70:51: warning: [clang-diagnostic-deprecated-declarations]

'localPos' is deprecated: Use position()

   70 |     QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),
      |                                                   ^
/usr/include/x86_64-linux-gnu/qt6/QtGui/qevent.h:226:5: note: 'localPos' has been explicitly marked deprecated here
  226 |     QT_DEPRECATED_VERSION_X_6_0("Use position()")
      |     ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:326:44: note: expanded from macro 'QT_DEPRECATED_VERSION_X_6_0'
  326 | # define QT_DEPRECATED_VERSION_X_6_0(text) QT_DEPRECATED_X(text)
      |                                            ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:238:33: note: expanded from macro 'QT_DEPRECATED_X'
  238 | #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
      |                                 ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qcompilerdetection.h:956:36: note: expanded from macro 'Q_DECL_DEPRECATED_X'
  956 | #  define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
      |                                    ^

clang-tidy diagnostic

custom3dinputhandler.cpp:70:70: warning: [clang-diagnostic-deprecated-declarations]

'globalPos' is deprecated: Use globalPosition()

   70 |     QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),
      |                                                                      ^
/usr/include/x86_64-linux-gnu/qt6/QtGui/qevent.h:215:5: note: 'globalPos' has been explicitly marked deprecated here
  215 |     QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
      |     ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:326:44: note: expanded from macro 'QT_DEPRECATED_VERSION_X_6_0'
  326 | # define QT_DEPRECATED_VERSION_X_6_0(text) QT_DEPRECATED_X(text)
      |                                            ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:238:33: note: expanded from macro 'QT_DEPRECATED_X'
  238 | #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
      |                                 ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qcompilerdetection.h:956:36: note: expanded from macro 'Q_DECL_DEPRECATED_X'
  956 | #  define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
      |                                    ^

@github-actions

Copy link
Copy Markdown

🚀 New build available for commit f1375c4
Download installer here

@atsju

atsju commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Hi Dale,
Congrats on the git usage. Looks like you are mastering it.

I fixed automated build. There are some remaining deprecation warnings that need to be fixed but the build is OK.

The feature is absolutely amazing and I love it.

Being used to 3D sodftwares, there is one flaw though:
right click + up/down or left/right motion always moves allong Y and X repectively. This is only good when you look from top.
If you ever rotated the 3D, all movements become more or less nonsensical.

Here is a capture of the "problem". Video was too large so there are 2 parts.

https://github.com/user-attachments/assets/fb927c69-8c56-433d-a345-d49c009ad9e4
https://github.com/user-attachments/assets/acf36f8c-24e5-4996-b945-d96e075e2ea5

But to be honnest I like this that much that I would like to get it merged and enhanced in a different PR.

One last note: I would advocate to make the right click "orbit". Because this is the way it was in the past. And while I don't care which click does what, I think it's better to keep some some of backcompatiblity and only modify/enhance what left click is doing.

@githubdoe

Copy link
Copy Markdown
Owner Author

The older versions use to be left click orbit. So that just restored to the old way and the way I find much 3D apps that I use.

@githubdoe

Copy link
Copy Markdown
Owner Author

Yes pan gets a little weird if you rotate too much. I bet we could get AI to fix that by remembering the current rotation.

@githubdoe

Copy link
Copy Markdown
Owner Author

Currently have the pan fixed in my local temp branch. Now trying on my local master.

@atsju

atsju commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Dale, do no forget to git pull your branch before you start modifications. That'"s because I made 2 commits on your remote branch for the .pro files and QT5 compatibility.

I do not expect any conflicts. But it's easier it you pull from the start than doing after you modified/commited on your local copy

@githubdoe

Copy link
Copy Markdown
Owner Author

Yes I finally got the pull figured out and the push is now done.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-tidy v21.1.8

Only 3 out of 6 clang-tidy concerns fit within this pull request's diff.

Have any feedback or feature suggestions? Share it here.

Comment thread custom3dinputhandler.cpp
mappedButtons = (mappedButtons & ~Qt::LeftButton) | Qt::RightButton;
}

QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

custom3dinputhandler.cpp:23:51: warning: [clang-diagnostic-deprecated-declarations]

'localPos' is deprecated: Use position()

   23 |     QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),
      |                                                   ^
/usr/include/x86_64-linux-gnu/qt6/QtGui/qevent.h:226:5: note: 'localPos' has been explicitly marked deprecated here
  226 |     QT_DEPRECATED_VERSION_X_6_0("Use position()")
      |     ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:326:44: note: expanded from macro 'QT_DEPRECATED_VERSION_X_6_0'
  326 | # define QT_DEPRECATED_VERSION_X_6_0(text) QT_DEPRECATED_X(text)
      |                                            ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:238:33: note: expanded from macro 'QT_DEPRECATED_X'
  238 | #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
      |                                 ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qcompilerdetection.h:956:36: note: expanded from macro 'Q_DECL_DEPRECATED_X'
  956 | #  define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
      |                                    ^

clang-tidy diagnostic

custom3dinputhandler.cpp:23:70: warning: [clang-diagnostic-deprecated-declarations]

'globalPos' is deprecated: Use globalPosition()

   23 |     QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),
      |                                                                      ^
/usr/include/x86_64-linux-gnu/qt6/QtGui/qevent.h:215:5: note: 'globalPos' has been explicitly marked deprecated here
  215 |     QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
      |     ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:326:44: note: expanded from macro 'QT_DEPRECATED_VERSION_X_6_0'
  326 | # define QT_DEPRECATED_VERSION_X_6_0(text) QT_DEPRECATED_X(text)
      |                                            ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:238:33: note: expanded from macro 'QT_DEPRECATED_X'
  238 | #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
      |                                 ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qcompilerdetection.h:956:36: note: expanded from macro 'Q_DECL_DEPRECATED_X'
  956 | #  define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
      |                                    ^

Comment thread custom3dinputhandler.cpp
mappedButtons = (mappedButtons & ~Qt::LeftButton) | Qt::RightButton;
}

QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

custom3dinputhandler.cpp:41:51: warning: [clang-diagnostic-deprecated-declarations]

'localPos' is deprecated: Use position()

   41 |     QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),
      |                                                   ^
/usr/include/x86_64-linux-gnu/qt6/QtGui/qevent.h:226:5: note: 'localPos' has been explicitly marked deprecated here
  226 |     QT_DEPRECATED_VERSION_X_6_0("Use position()")
      |     ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:326:44: note: expanded from macro 'QT_DEPRECATED_VERSION_X_6_0'
  326 | # define QT_DEPRECATED_VERSION_X_6_0(text) QT_DEPRECATED_X(text)
      |                                            ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:238:33: note: expanded from macro 'QT_DEPRECATED_X'
  238 | #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
      |                                 ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qcompilerdetection.h:956:36: note: expanded from macro 'Q_DECL_DEPRECATED_X'
  956 | #  define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
      |                                    ^

clang-tidy diagnostic

custom3dinputhandler.cpp:41:70: warning: [clang-diagnostic-deprecated-declarations]

'globalPos' is deprecated: Use globalPosition()

   41 |     QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),
      |                                                                      ^
/usr/include/x86_64-linux-gnu/qt6/QtGui/qevent.h:215:5: note: 'globalPos' has been explicitly marked deprecated here
  215 |     QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
      |     ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:326:44: note: expanded from macro 'QT_DEPRECATED_VERSION_X_6_0'
  326 | # define QT_DEPRECATED_VERSION_X_6_0(text) QT_DEPRECATED_X(text)
      |                                            ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:238:33: note: expanded from macro 'QT_DEPRECATED_X'
  238 | #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
      |                                 ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qcompilerdetection.h:956:36: note: expanded from macro 'Q_DECL_DEPRECATED_X'
  956 | #  define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
      |                                    ^

Comment thread custom3dinputhandler.cpp
mappedButtons = (mappedButtons & ~Qt::LeftButton) | Qt::RightButton;
}

QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

custom3dinputhandler.cpp:90:51: warning: [clang-diagnostic-deprecated-declarations]

'localPos' is deprecated: Use position()

   90 |     QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),
      |                                                   ^
/usr/include/x86_64-linux-gnu/qt6/QtGui/qevent.h:226:5: note: 'localPos' has been explicitly marked deprecated here
  226 |     QT_DEPRECATED_VERSION_X_6_0("Use position()")
      |     ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:326:44: note: expanded from macro 'QT_DEPRECATED_VERSION_X_6_0'
  326 | # define QT_DEPRECATED_VERSION_X_6_0(text) QT_DEPRECATED_X(text)
      |                                            ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:238:33: note: expanded from macro 'QT_DEPRECATED_X'
  238 | #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
      |                                 ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qcompilerdetection.h:956:36: note: expanded from macro 'Q_DECL_DEPRECATED_X'
  956 | #  define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
      |                                    ^

clang-tidy diagnostic

custom3dinputhandler.cpp:90:70: warning: [clang-diagnostic-deprecated-declarations]

'globalPos' is deprecated: Use globalPosition()

   90 |     QMouseEvent customEvent(event->type(), event->localPos(), event->globalPos(),
      |                                                                      ^
/usr/include/x86_64-linux-gnu/qt6/QtGui/qevent.h:215:5: note: 'globalPos' has been explicitly marked deprecated here
  215 |     QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
      |     ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:326:44: note: expanded from macro 'QT_DEPRECATED_VERSION_X_6_0'
  326 | # define QT_DEPRECATED_VERSION_X_6_0(text) QT_DEPRECATED_X(text)
      |                                            ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:238:33: note: expanded from macro 'QT_DEPRECATED_X'
  238 | #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
      |                                 ^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qcompilerdetection.h:956:36: note: expanded from macro 'Q_DECL_DEPRECATED_X'
  956 | #  define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
      |                                    ^

@atsju

atsju commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Nice.
I will have less time for the rest of the day. George will proably try it out too.

If you could fix the deprecation warnings too it would be great. I'm unsure if Qt5 supports position() and globalPosition() so you might need an ifdef.

Thank you !

@github-actions

Copy link
Copy Markdown

🚀 New build available for commit f379740
Download installer here

@atsju

atsju commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

I tested it. It's much better !

I belive mouse click + Y moving is not working on the correct axis. It does the same as scrolling with weel when in fact it shall behave similarly as X moving.

I might not be 100% clear. Let me know and I can do a video

@githubdoe

Copy link
Copy Markdown
Owner Author

Added the ifdef for QT5 and Qt6. I wish I had the time to switch to Qt6. I don't like those flags. I know George once showed my how to switch but that has been lost by me.

I think the mouse does what I wanted it to do. Which is show the wave front from any reasonable angle zoom it and pan it. i was surprised when I opened Fusion 360 that orbit is on the right button and my muscle memory took over and used it to orbit. Yet when I use DFTFringe that muscle memory is for the left button because that was what it was for years. So it will mess with those that never knew left orbit for DFtfringe. Sorry.

@github-actions

Copy link
Copy Markdown

🚀 New build available for commit bd9360c
Download installer here

@gr5

gr5 commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

This removes nothing - it only adds more capability. Switching between qt5 and qt6 doesn't even require exiting qt creator after you follow these directions.

https://youtu.be/ZHo5vspf6BQ

Unfortunately the standard project files have all relative paths so if you have many different cloned repositories, you have to add the new folders to each repository. I suppose that only takes a few more minutes.

these 2 lines of code not needed.

Co-authored-by: Julien Staub <atsju2@yahoo.fr>
@github-actions

Copy link
Copy Markdown

🚀 New build available for commit e4e44be
Download installer here

@gr5 gr5 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried it out. Didn't build it as Dale already did. This feature works great. Code looks great.

Dale this can be merged now. You want to click the button here on github or is it okay if I do it? Do you have more changes in mind or is this ready in your opinion. It is ready in my opinion.

@githubdoe

Copy link
Copy Markdown
Owner Author

It is ready to merge. Go ahead.

@gr5
gr5 merged commit 17a7cf7 into master Aug 25, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3D view mouse controls revamp

3 participants