theia-ide / sprotty

A next-gen web-based graphics framework
Apache License 2.0
138 stars 23 forks source link

Navigation collides with mouse gestures #154

Closed le-cds closed 7 years ago

le-cds commented 7 years ago

Sprotty, at least by default, uses the right mouse button to move the viewport. In some browsers, this collides with mouse gestures. Also, do context menus work?

JanKoehnlein commented 7 years ago

Could you elaborate in which browsers you observed that and on which platforms, and which gestures?

Currently there are no context menus in sprotty. The right-click should be consumed by the mouse tool and as such not be forwarded to the application. What kind of behavior do you expect?

le-cds commented 7 years ago

Could you elaborate in which browsers you observed that and on which platforms

Opera provides mouse gestures by default. On Firefox, I have the Mouse Gestures Suite add-on installed. This should be independent of the platform. I'm running Mac OS X as I'm typing this.

and which gestures?

The "Back" gesture, for example. The gesture usually is "Press right mouse button, move mouse left, release right mouse button." If I do that to move the diagram, what happens is that the browser instead navigates to the previous page. For example, go to ELK Live, click on the "ELKT Editor" button, and move the diagram the way I just described. You'll be taken back to the ELK Live homepage if you have mouse gestures installed.

What kind of behavior do you expect?

As a user, it actually confused me that nothing happens. For example, ELK Live doesn't provide a custom context menu, so the standard browser context menu is what I would have expected.

JanKoehnlein commented 7 years ago

Opera provides mouse gestures by default. On Firefox, I have the Mouse Gestures Suite add-on installed. This should be independent of the platform. I'm running Mac OS X as I'm typing this.

Interesting. How do these behave with e.g. Google Maps, where a right-click drag results in a zoom?

If we bound panning to left-click drag by default, would that collide with something else?

le-cds commented 7 years ago

Interesting. How do these behave with e.g. Google Maps, where a right-click drag results in a zoom?

The mouse gesture wins. In fact, I didn't even know that right-click-drag zooms since simple using the mouse wheel also zooms.

If we bound panning to left-click drag by default, would that collide with something else?

No, that would be fine. In fact, it would probably be a better match for user expectations since that's how panning works in Google Maps and similar applications. I was wondering why that wasn't already the default. My best guess was that you wanted to reserve left-click-drag for selections.

spoenemann commented 7 years ago

Maybe we could offer two interaction modes:

  1. Viewer: pan with left-click-drag (default setting)
  2. Editor: pan with right-click-drag, select multiple items with left-click-drag
uruuru commented 7 years ago

Google Maps, where a right-click drag results in a zoom?

Out of curiosity: We were not able to see this behavior, neither on Windows, nor on Linux, or Mac (Firefox, Chrome, Safari).

spoenemann commented 7 years ago

Another reason for making left-click-drag the preferred scroll tool: right-click-drag does not work in the SWT browser.

JanKoehnlein commented 7 years ago

Switched to left-drag for panning.