Hi,
I need to implement the ctrl + mouse wheel event with the same behaviour with shift+mouse wheel.
Any idea?
Hi,
I need to implement the ctrl + mouse wheel event with the same behaviour with shift+mouse wheel.
Any idea?
I recommend overriding the ToolManager.doMouseWheel method to do what you want. Tool.standardMouseWheel describes what it normally does.
I try this code but it doesnt work
myFullDiagram.toolManager.doMouseWheel = function (e, obj) {
if (myFullDiagram.lastInput.control) {
myFullDiagram.allowHorizontalScroll = true;
this.standardMouseWheel();
}
};
If I understand you correctly, it might be easier to modify the InputEvent – swapping the control and shift modifiers.
Yes, you understand me correctly. Do you have an example?
myDiagram.toolManager.doMouseWheel = function() {
// swap the InputEvent.control and .shift properties
var e = myDiagram.lastInput;
if (e.control) e.modifiers = 4;
else if (e.shift) e.modifiers = 1;
// now call the base method
go.ToolManager.prototype.doMouseWheel.call(myDiagram.toolManager);
};
In the future we will make the InputEvent.control and InputEvent.shift properties settable, so that you won’t need to know the HTML modifier flag values.
Thanks Walter!