nglviewer / ngl

WebGL protein viewer
http://nglviewer.org/ngl/
MIT License
657 stars 168 forks source link

added scroll for focusScroll in pymol mouse controls #992

Closed chmnk closed 8 months ago

chmnk commented 1 year ago

Both scroll and drag-shift-right do focusScroll action in pymol, but scroll is more intuitive, because this makes controls mouse-only.

fredludlow commented 1 year ago

I'm not familiar with pymol controls but this seems sensible. @ppillot ?

papillot commented 1 year ago

I don't use Pymol either. In the version I have, the mouse wheel seems to only move the front clipping pane. Zooming is done through right click or wheel + Ctrl + Shift

image

I agree that scroll to zoom seems more intuitive, but I am not sure it's the default specification for Pymol?

chmnk commented 1 year ago

Zooming is done through right click or wheel + Ctrl + Shift

@papillot In your figure the editing mode is shown. I think the default pymol's mode is viewing, and the current pymol configuration in ngl seems to represent the viewing mode.

I agree that scroll to zoom seems more intuitive

No, I am not talking about zooming, I meant clipping. Zooming in pymol's viewing mode is the drag_right and that's nice and clean, and is already implemented in ngl.

In the version I have, the mouse wheel seems to only move the front clipping plane.

Following this reference https://pymol.org/dokuwiki/doku.php?id=mouse:clipping, in the viewing mode, scroll expands or shrinks the area between the clipping planes. That area is called "slab". As it is better explained here https://pymol.sourceforge.net/newman/user/S0200start.html, shift+drag_right has more flexible behaviour that depends on the direction of dragging (up-down / left-right for moving front/back clipping planes instead of moving them as whole).

What I experienced in ngl with focusScroll reminded me the simple scroll action in pymol, which is the motivation of this request.

PS Actually when I started this, I didn't know the details of how does shift+drag_right work in pymol (I thought it's the same as scroll) :D