# Camera Controls with 3D Trackpad

**URL:** <https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506>\
**Category:** Design & Interface\
**Created:** [August 26, 2026, 2:08pm UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506 "2026-08-26T14:08:29Z")\
**Posts on this page:** 19\
**Page:** 2

<div class="post-metadata">

**Author:** ![vhanzl](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/vhanzl/32/3557_2.png) [@vhanzl](https://discuss.avogadro.cc/u/vhanzl)\
**Post date:** [August 29, 2026, 8:12pm UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/21 "2026-08-29T20:12:06Z")

</div>

OK, so I will make it into a draft PR to have a place to work. Then I can add few obviously missing items (like RotTrackball set in other places) in another commit.  
For the actual formulas used, I opted for low disruption to users used to the old scheme - inside a trackball ring, it stays the same - but there are other ways and certainly some users will argue for them. Here is a [nice playground to test some methods](https://theshamblog.com/virtual-trackballs-a-taxonomy-and-new-method/). But I would build with any method (like my current one) to have something, changing the formula (or having a choice of some) is a nicely isolated change to eventually do later.

Edit: It is in [PR2962](https://github.com/OpenChemistry/avogadrolibs/pull/2962) now.

---

<div class="post-metadata">

**Author:** ![vhanzl](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/vhanzl/32/3557_2.png) [@vhanzl](https://discuss.avogadro.cc/u/vhanzl)\
**Post date:** [August 29, 2026, 9:53pm UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/22 "2026-08-29T21:53:15Z")

</div>

@ghutchis After build, we could now test the trackball mode in Navigation Mode only when Alt-drag is used (should rotate Z axis when dragged far away from screen center).

---

<div class="post-metadata">

**Author:** ![vhanzl](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/vhanzl/32/3557_2.png) [@vhanzl](https://discuss.avogadro.cc/u/vhanzl)\
**Post date:** [August 30, 2026, 7:49am UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/23 "2026-08-30T07:49:53Z")

</div>

Build done, the logic mostly works as intended, it just rotates Z in countersense and about 3.5 times slower than it should 😄 Likely some scaling constants and sense inversion, I’ll fix it.

---

<div class="post-metadata">

**Author:** ![vhanzl](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/vhanzl/32/3557_2.png) [@vhanzl](https://discuss.avogadro.cc/u/vhanzl)\
**Post date:** [August 30, 2026, 10:24am UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/24 "2026-08-30T10:24:42Z")

</div>

Hopefully fixed, ready for a build (I expect correct trackball behavior for Alt-drag, in Navigation Tool only for now).

In the meantime, for anybody testing this:  
**On Linux:** If Alt-drag moves the whole window instead, do something like this:  
menu Applications / Settings / Window Manager Tweaks / Accessibility / Key used to grab and move windows: Alt → None  
**On Mac:** You may need to do a security fix in terminal (I need it for the official builds as well):  
`sudo xattr -cr /Applications/Avogadro2.app`  
`codesign --force --deep --sign - /Applications/Avogadro2.app`  
These are the symptoms that you need it (for googlers) :  
“Avogadro2” is damaged and can’t be opened, You should move it to the trash.  
Exception Type: EXC\_BAD\_ACCESS (SIGKILL (Code Signature Invalid))  
Exception Codes: UNKNOWN\_0x32 at 0x0000000100d88000  
Exception Codes: 0x0000000000000032, 0x0000000100d88000

---

<div class="post-metadata">

**Author:** ![vhanzl](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/vhanzl/32/3557_2.png) [@vhanzl](https://discuss.avogadro.cc/u/vhanzl)\
**Post date:** [August 30, 2026, 11:41am UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/25 "2026-08-30T11:41:23Z")

</div>

ARM Mac build from my forked repo is [here](https://github.com/vaclavhanzl/avogadrolibs/actions/runs/33308544652/artifacts/9731473213) for anybody to try and it works as I expected.

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [August 30, 2026, 12:04pm UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/26 "2026-08-30T12:04:45Z")

</div>

> [@vhanzl](#):
>
> You may need to do a security fix in terminal (I need it for the official builds as well):

The official builds are signed on merge. There’s an official cert for the continuous builds and releases.

There’s no good way to sign pull requests in progress, no.

---

<div class="post-metadata">

**Author:** ![vhanzl](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/vhanzl/32/3557_2.png) [@vhanzl](https://discuss.avogadro.cc/u/vhanzl)\
**Post date:** [August 30, 2026, 12:19pm UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/27 "2026-08-30T12:19:24Z")

</div>

> There’s an official cert for the continuous builds and releases.

Is it expected to work with weekly builds? (I think it does not for me - I tried either these or stable build, have to retry to be sure - but at least one of them fails for me.)

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [August 30, 2026, 12:26pm UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/28 "2026-08-30T12:26:54Z")

</div>

I have to periodically update the cert - if there’s a problem with the current continuous build, let me know.

The official version releases are tested on a few Macs before it’s made public. (Similar with the signed Windows installers.)

---

<div class="post-metadata">

**Author:** ![vhanzl](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/vhanzl/32/3557_2.png) [@vhanzl](https://discuss.avogadro.cc/u/vhanzl)\
**Post date:** [August 30, 2026, 12:49pm UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/29 "2026-08-30T12:49:30Z")

</div>

> I have to periodically update the cert - if there’s a problem with the current continuous build, let me know.

I just tested both Current Release and Nightly Build for Apple Silicon (from the [Avogadro site](https://avogadro.cc/install/index.html#install)) and both work. I must have downloaded on some less lucky no-cert day for Mac and never tried again (using it on Linux only),

---

<div class="post-metadata">

**Author:** ![vhanzl](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/vhanzl/32/3557_2.png) [@vhanzl](https://discuss.avogadro.cc/u/vhanzl)\
**Post date:** [August 30, 2026, 1:48pm UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/30 "2026-08-30T13:48:41Z")

</div>

So how shall we proceed @ghutchis ? One possible course would be just work towards merge of [PR2962](https://github.com/OpenChemistry/avogadrolibs/pull/2962) with the current functionality. It is pretty non-obtrusive, providing a bit more functionality to those who press Alt (happens to already work in half the tools) and not doing any harm to others. Then later on we could:

- Decide on which buttons zoom/pan belong and add these
- Let more tools propagate Alt-drag to trackball
- Maybe work on better virtual trackball variants, using this one as a clear basis

I would now rename the PR to just “Camera Controls with Virtual Trackball” leaving out “Global”, you would eventually do code review and we would be one incremental step further.  
What do you think?

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [August 30, 2026, 2:16pm UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/31 "2026-08-30T14:16:24Z")

</div>

> [@vhanzl](#):
>
> - Let more tools propagate Alt-drag to trackball

I think that should already happen. Right now, if a tool doesn’t capture an event, it should “fall through” to the navigation.

Today is probably going to be a bit busy, but I’ll try it out sometime on Monday including code review (it’s not a lot).

> [@vhanzl](#):
>
> we would be one incremental step further.

Yes, that’s always the idea. 🙂

---

<div class="post-metadata">

**Author:** ![vhanzl](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/vhanzl/32/3557_2.png) [@vhanzl](https://discuss.avogadro.cc/u/vhanzl)\
**Post date:** [August 30, 2026, 2:39pm UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/32 "2026-08-30T14:39:10Z")

</div>

One last change I am considering in this step is normalizing XY rotations speed in such a way that crossing the virtual trackball circle edge to edge results always in the same amount of molecule rotation (e.g. 360 degrees, as this seems to be in pymol). This would make the sensitivity different with Alt (likely higher) but would make it independent on resolutions and window size. With global navigation available, the Navigation Tool may likely become specialized for very precise navigation so this would already differentiate that way. Limiting the XY area to a circle only, the XY rotation span feels a bit insufficient now.

---

<div class="post-metadata">

**Author:** ![vhanzl](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/vhanzl/32/3557_2.png) [@vhanzl](https://discuss.avogadro.cc/u/vhanzl)\
**Post date:** [August 30, 2026, 6:19pm UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/33 "2026-08-30T18:19:39Z")

</div>

Done, works. Ready for tests and review (see last comment in [PR2962](https://github.com/OpenChemistry/avogadrolibs/pull/2962) for executables to try).

---

<div class="post-metadata">

**Author:** ![vhanzl](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/vhanzl/32/3557_2.png) [@vhanzl](https://discuss.avogadro.cc/u/vhanzl)\
**Post date:** [September 1, 2026, 4:04pm UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/34 "2026-09-01T16:04:22Z")

</div>

Funny. What I wished for most at the start of this thread:

> [@vhanzl](#):
>
> Better yet, have some proper way to remote control this [x y z angles of camera]

sits in the Avogadro [source code](https://github.com/OpenChemistry/avogadrolibs/blob/20ccd76f84af41b5b30350a98d4b3ee5c160857f/avogadro/qtplugins/navigator/navigator.cpp#L74) for some 3 years already, it is just missing in the [docs](https://avogadro.cc/develop/rpc.html). Just discovered this while thinking “OK, now to my original goal, I’ll make another PR for camera RPC” 🙂 So for the records and all googlers coming here, Avogadro camera can be remote controlled by RPC, as demonstrated in my [test script](https://github.com/vaclavhanzl/trackball3D/blob/93fe9d4140c6dcd3b6e5a378206a4562096c32e7/debug_tools/test_avogadro_rotation.py). So I’ll use these for my physical [3D billiard ball control device](https://www.printables.com/model/1787278-trackball3d).  
Regarding other RPC capabilities hidden in Avogadro, source code inspection suggests at least these exist:  
addBondOrders alignAtom alignView centerAtom createBonds exportFile fillTranslationalCell fillUnitCell kill loadMolecule openFile removeBonds rotateScene saveGraphic setProjection setRenderTypes setVibrationalAmplitude setVibrationalMode showVibrations standardCrystalOrientation startVibrationAnimation stopVibrationAnimation translateScene wrapUnitCell zoomScene  
(For the [PR2962](https://github.com/OpenChemistry/avogadrolibs/pull/2962) side effect of my effort, I am of course willing to finish and/or improve it.)

AI is really clueless about camera RPC in Avogadro, I had to force it to look precisely at the right source code file to finally acknowledge that the functionality exists…

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [September 1, 2026, 4:53pm UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/35 "2026-09-01T16:53:29Z")

</div>

> [@vhanzl](#):
>
> controlled by RPC, as demonstrated in my [test script](https://github.com/vaclavhanzl/trackball3D/blob/93fe9d4140c6dcd3b6e5a378206a4562096c32e7/debug_tools/test_avogadro_rotation.py)

You can do that more easily with the `avogadro` PyPI package, which includes `avogadro.connect` for JSON-RPC: [avogadro/connect.py](https://github.com/OpenChemistry/avogadrolibs/blob/1b7d459e3f0d1b09963070588403ea9799bc9f70/python/avogadro/connect.py)

> [@vhanzl](#):
>
> AI is really clueless about camera RPC in Avogadro, I had to force it to look precisely at the right source code file to finally acknowledge that the functionality exists…

I’ve posted a few times asking for suggestions on RPC features for automation, e.g. [Tasks for Automation](https://discuss.avogadro.cc/t/tasks-for-automation/3951)

Suggestions are definitely welcome on new capabilities.

As far as AI, I’d welcome ways to make that more obvious, e.g. a list of commands. I know the new MCP mechanism is basically JSON-RPC, but haven’t had time to look into ways to expose the existing local RPC mechanism to scripting or automation.

If that’s something that interests you, let’s open a new thread.

---

<div class="post-metadata">

**Author:** ![vhanzl](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/vhanzl/32/3557_2.png) [@vhanzl](https://discuss.avogadro.cc/u/vhanzl)\
**Post date:** [September 1, 2026, 7:48pm UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/36 "2026-09-01T19:48:43Z")

</div>

> [@ghutchis](#):
>
> e.g. a list of commands.

I created [Issue #237](https://github.com/Avogadro/two.avogadro.cc/issues/237) regarding the missing docs, I personally will not be able to touch it for two months now (but can return to it later if still needed).

> avogadro/connect.py

Sure, seen it. I now marked my script as just an AI-made dirty way to verify that Avogadro has rotate RPC and linked to connect.py as a way to do it properly.

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [September 3, 2026, 6:40pm UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/37 "2026-09-03T18:40:52Z")

</div>

Okay, it’s now merged for broader testing.

I’m currently working on the other camera controls I mentioned in the thread (e.g., Ctrl + arrow = pan, etc.)

---

<div class="post-metadata">

**Author:** ![vhanzl](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/vhanzl/32/3557_2.png) [@vhanzl](https://discuss.avogadro.cc/u/vhanzl)\
**Post date:** [September 3, 2026, 7:40pm UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/38 "2026-09-03T19:40:43Z")

</div>

Great, thanks. (And also thanks for the great new docs on RPC! Used it already.)

For virtual trackball, using it three days, I see myself pressing Alt in the Navigation Tool all the time, I’d want the mode as default. And the switch between XY mode and Z mode on trackball perimeter feels abrupt (even though it mimics quite exactly pomol’s trackball which I liked till now). So I consider another PR which would add “trackball mode” selection just below “Reverse Direction of Zoom on Scroll”:

- Classical XY mode (what mouse drag did before)
- XY / Z pymol-like (what it now does with Alt)
- XY / Z with smoothed transition between XY and Z (new third mode)

and maybe some sensitivity control as well.  
The same behavior could be available both with Alt and without Alt in the Navigation Mode, making the navigation enforceable by Alt in all other tools.

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [September 4, 2026, 1:04am UTC](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506/39 "2026-09-04T01:04:03Z")

</div>

> [@vhanzl](#):
>
> So I consider another PR which would add “trackball mode” selection

This would be good also to make the ‘trackball mode’ more discoverable.

> [@vhanzl](#):
>
> The same behavior could be available both with Alt and without Alt in the Navigation Mode, making the navigation enforceable by Alt in all other tools.

I think this makes sense too.

And I believe I got every “shared camera control” piece into this PR, though it also requires an avgoadroapp piece to finish:

> <https://github.com/OpenChemistry/avogadrolibs/pull/2972>
>
> \- Alt drag for rotate, zoom, etc.
> \- Control + arrows for pan
> 
> Developer Certi…ficate of Origin
> Version 1.1
> 
> Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
> 1 Letterman Drive
> Suite D4700
> San Francisco, CA, 94129
> 
> Everyone is permitted to copy and distribute verbatim copies of this
> license document, but changing it is not allowed.
> 
> 
> Developer's Certificate of Origin 1.1
> 
> By making a contribution to this project, I certify that:
> 
> (a) The contribution was created in whole or in part by me and I
> have the right to submit it under the open source license
> indicated in the file; or
> 
> (b) The contribution is based upon previous work that, to the best
> of my knowledge, is covered under an appropriate open source
> license and I have the right under that license to submit that
> work with modifications, whether created in whole or in part
> by me, under the same open source license (unless I am
> permitted to submit under a different license), as indicated
> in the file; or
> 
> (c) The contribution was provided directly to me by some other
> person who certified (a), (b) or (c) and I have not modified
> it.
> 
> (d) I understand and agree that this project and the contribution
> are public and that a record of the contribution (including all
> personal information I submit with it, including my sign-off) is
> maintained indefinitely and may be redistributed consistent with
> this project or the open source license(s) involved.
> 
> 
> 
> 
> \## Summary by CodeRabbit
> 
> \- \*\*New Features\*\*
> - Added configurable camera-navigation gestures, including mouse and keyboard controls.
> - Right-dragging in editing tools now supports camera navigation without accidental atom or bond deletion.
> - Right-click deletion occurs only when the pointer release qualifies as a click.
> - Added navigation guidance to the Navigator tool’s tooltip.
> 
> \- \*\*Improvements\*\*
> - Z-axis rotation shortcuts now use Ctrl+Shift+Left/Right, avoiding conflicts with navigation controls.
> - Improved safety when navigating if the associated 3D view is unavailable.

[Previous page](https://discuss.avogadro.cc/t/camera-controls-with-3d-trackpad/7506.md?page=1)
