Browse Source

Disable `ctrl` / `shift` zoom when `ctrl` is required for mouse wheel zoom.

pull/952/head
Matthew Petroff 3 years ago
parent
commit
e601519157
2 changed files with 6 additions and 1 deletions
  1. +2
    -1
      doc/json-config-parameters.md
  2. +4
    -0
      src/js/pannellum.js

+ 2
- 1
doc/json-config-parameters.md View File

@@ -101,7 +101,8 @@ If set to `false`, zooming with mouse wheel will be disabled. Defaults to `true`
Can also be set to `fullscreenonly`, in which case it is only enabled when the Can also be set to `fullscreenonly`, in which case it is only enabled when the
viewer is fullscreen. Can also be set to `ctrl`, in which case the `ctrl` key viewer is fullscreen. Can also be set to `ctrl`, in which case the `ctrl` key
must be held down to zoom with the mouse wheel (except while the viewer is must be held down to zoom with the mouse wheel (except while the viewer is
fullscreen).
fullscreen); when the `ctrl` key is required for mouse wheel zooming, the use
of `ctrl` / `shift` for zoom control is disabled.




### `doubleClickZoom` (boolean) ### `doubleClickZoom` (boolean)


+ 4
- 0
src/js/pannellum.js View File

@@ -1177,6 +1177,10 @@ function onDocumentKeyPress(event) {
// Override default action for keys that are used // Override default action for keys that are used
if (config.capturedKeyNumbers.indexOf(keynumber) < 0) if (config.capturedKeyNumbers.indexOf(keynumber) < 0)
return; return;
if (!fullscreenActive && (keynumber == 16 || keynumber == 17) && config.mouseZoom == 'ctrl')
// Disable ctrl / shift zoom when holding the ctrl key is required for
// scroll wheel zooming
return;
event.preventDefault(); event.preventDefault();
// If escape key is pressed // If escape key is pressed


Loading…
Cancel
Save