DraggingTool: Keylistener / other mouse button combination
Posted: Fri 3. Oct 2008, 15:08
Hi,
I am using the DraggingTool class. I found out that it can also be used for dragging along the z axis by pressing <ctrl> and center mouse button while moving the mouse. But: The <ctrl> key works only if I do a left click to the canvas. Otherwise the corresponding keylistener seems not to be listening. The mouselistener is working without clicking the canvas with the left mouse button.
I tried to request the focus in the "activate" method of the DraggingTool (viewer.getViewingComponent().requestFocus()), but it didn't work.
Now two questions:
1. Is it possible to create a workaround in the DraggingTool to make the <ctrl> key working without clicking the canvas?
2. Instead of the <ctrl> key, can I modify the DraggingTool to be activate if the center and the left mouse buttons are pressed together? The RotateTool should not be activated in this case (because if only the left mouse button is pressed, a rotation is done).
Many thanks and best regards, Joe
I am using the DraggingTool class. I found out that it can also be used for dragging along the z axis by pressing <ctrl> and center mouse button while moving the mouse. But: The <ctrl> key works only if I do a left click to the canvas. Otherwise the corresponding keylistener seems not to be listening. The mouselistener is working without clicking the canvas with the left mouse button.
I tried to request the focus in the "activate" method of the DraggingTool (viewer.getViewingComponent().requestFocus()), but it didn't work.
Now two questions:
1. Is it possible to create a workaround in the DraggingTool to make the <ctrl> key working without clicking the canvas?
2. Instead of the <ctrl> key, can I modify the DraggingTool to be activate if the center and the left mouse buttons are pressed together? The RotateTool should not be activated in this case (because if only the left mouse button is pressed, a rotation is done).
Many thanks and best regards, Joe