mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Scroll the view with WASD/Cursor keys when nothing selected
This commit is contained in:
parent
e94634544c
commit
a54ca699b5
@ -44,6 +44,14 @@
|
|||||||
"ctrl-y": "core:redo",
|
"ctrl-y": "core:redo",
|
||||||
"ctrl-a": "core:select-all-nodes",
|
"ctrl-a": "core:select-all-nodes",
|
||||||
"shift-?": "core:show-help",
|
"shift-?": "core:show-help",
|
||||||
|
"w": "core:scroll-view-up",
|
||||||
|
"d": "core:scroll-view-right",
|
||||||
|
"s": "core:scroll-view-down",
|
||||||
|
"a": "core:scroll-view-left",
|
||||||
|
"shift-w": "core:step-view-up",
|
||||||
|
"shift-d": "core:step-view-right",
|
||||||
|
"shift-s": "core:step-view-down",
|
||||||
|
"shift-a": "core:step-view-left",
|
||||||
"up": "core:move-selection-up",
|
"up": "core:move-selection-up",
|
||||||
"right": "core:move-selection-right",
|
"right": "core:move-selection-right",
|
||||||
"down": "core:move-selection-down",
|
"down": "core:move-selection-down",
|
||||||
|
@ -105,6 +105,8 @@ RED.view.tools = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
RED.view.redraw();
|
RED.view.redraw();
|
||||||
|
} else {
|
||||||
|
RED.view.scroll(dx*10,dy*10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,6 +114,16 @@ RED.view.tools = (function() {
|
|||||||
init: function() {
|
init: function() {
|
||||||
RED.actions.add("core:align-selection-to-grid", alignToGrid);
|
RED.actions.add("core:align-selection-to-grid", alignToGrid);
|
||||||
|
|
||||||
|
RED.actions.add("core:scroll-view-up", function() { RED.view.scroll(0,-RED.view.gridSize());});
|
||||||
|
RED.actions.add("core:scroll-view-right", function() { RED.view.scroll(RED.view.gridSize(),0);});
|
||||||
|
RED.actions.add("core:scroll-view-down", function() { RED.view.scroll(0,RED.view.gridSize());});
|
||||||
|
RED.actions.add("core:scroll-view-left", function() { RED.view.scroll(-RED.view.gridSize(),0);});
|
||||||
|
|
||||||
|
RED.actions.add("core:step-view-up", function() { RED.view.scroll(0,-5*RED.view.gridSize());});
|
||||||
|
RED.actions.add("core:step-view-right", function() { RED.view.scroll(5*RED.view.gridSize(),0);});
|
||||||
|
RED.actions.add("core:step-view-down", function() { RED.view.scroll(0,5*RED.view.gridSize());});
|
||||||
|
RED.actions.add("core:step-view-left", function() { RED.view.scroll(-5*RED.view.gridSize(),0);});
|
||||||
|
|
||||||
RED.actions.add("core:move-selection-up", function() { moveSelection(0,-1);});
|
RED.actions.add("core:move-selection-up", function() { moveSelection(0,-1);});
|
||||||
RED.actions.add("core:move-selection-right", function() { moveSelection(1,0);});
|
RED.actions.add("core:move-selection-right", function() { moveSelection(1,0);});
|
||||||
RED.actions.add("core:move-selection-down", function() { moveSelection(0,1);});
|
RED.actions.add("core:move-selection-down", function() { moveSelection(0,1);});
|
||||||
|
@ -3846,6 +3846,10 @@ RED.view = (function() {
|
|||||||
type: "compact",
|
type: "compact",
|
||||||
buttons: buttons
|
buttons: buttons
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
scroll: function(x,y) {
|
||||||
|
chart.scrollLeft(chart.scrollLeft()+x);
|
||||||
|
chart.scrollTop(chart.scrollTop()+y)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
Loading…
Reference in New Issue
Block a user