jonigata commited on
Commit
772acdc
·
1 Parent(s): c8da9c0

fix a bug that all keys are ignored

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. static/poseEditor.js +1 -4
app.py CHANGED
@@ -129,7 +129,7 @@ Points to note for pseudo-3D rotation: When performing pseudo-3D rotation on the
129
  - "alt + drag" to **move**
130
  - "shift + drag" to **rotate** (move right first, release shift, then up or down)
131
  - "space + drag" to **range-move**
132
- - "[", "]" or mouse wheel to shrink or expand **range**
133
  - "ctrl + z", "shift + ctrl + z" to **undo**, **redo**
134
  - "ctrl + E" **add** new person
135
  - "Q + click" to **delete** person
 
129
  - "alt + drag" to **move**
130
  - "shift + drag" to **rotate** (move right first, release shift, then up or down)
131
  - "space + drag" to **range-move**
132
+ - "[", "]" or mouse "Alt + wheel" to shrink or expand **range**
133
  - "ctrl + z", "shift + ctrl + z" to **undo**, **redo**
134
  - "ctrl + E" **add** new person
135
  - "Q + click" to **delete** person
static/poseEditor.js CHANGED
@@ -513,6 +513,7 @@ function ModifyDragRange(delta) { dragRange = Math.max(dragRangeDelta, Math.min(
513
 
514
  document.addEventListener('wheel', function(event) {
515
  if (!isMouseOnCanvas(event)) {return;}
 
516
 
517
  event.preventDefault();
518
  const deltaY = event.deltaY;
@@ -524,8 +525,6 @@ document.addEventListener('wheel', function(event) {
524
  }, {passive: false});
525
 
526
  document.addEventListener("keydown", (event) => {
527
- if (!isMouseOnCanvas(event)) {return;}
528
-
529
  if (event.code == "BracketLeft") { ModifyDragRange(-dragRangeDelta); }
530
  if (event.code == "BracketRight") { ModifyDragRange(dragRangeDelta); }
531
  keyDownFlags[event.code] = true;
@@ -533,8 +532,6 @@ document.addEventListener("keydown", (event) => {
533
  event.preventDefault();
534
  });
535
  document.addEventListener("keyup", (event) => {
536
- if (!isMouseOnCanvas(event)) {return;}
537
-
538
  keyDownFlags[event.code] = false;
539
  if (event.ctrlKey && event.code == "KeyE") {
540
  addPerson();
 
513
 
514
  document.addEventListener('wheel', function(event) {
515
  if (!isMouseOnCanvas(event)) {return;}
516
+ if (!event.altKey) {return;}
517
 
518
  event.preventDefault();
519
  const deltaY = event.deltaY;
 
525
  }, {passive: false});
526
 
527
  document.addEventListener("keydown", (event) => {
 
 
528
  if (event.code == "BracketLeft") { ModifyDragRange(-dragRangeDelta); }
529
  if (event.code == "BracketRight") { ModifyDragRange(dragRangeDelta); }
530
  keyDownFlags[event.code] = true;
 
532
  event.preventDefault();
533
  });
534
  document.addEventListener("keyup", (event) => {
 
 
535
  keyDownFlags[event.code] = false;
536
  if (event.ctrlKey && event.code == "KeyE") {
537
  addPerson();