[Closed] keypress within mouse tool
Hi,
I’m using a mouse tool to populate a scene with planes. I’d like the user to be able to preview and adjust the size of the plane before they click to create it. Initially I looked at the gw drawing methods, but didn’t like the outcome, so instead, I’m creating a rectangle at the tool start which is the same size as the plane that will be created when the user clicks. I’m using the freemove clause and testing to see if the user clicks the ctrl key, and scaling the rectangle when it’s true. This works well but it only scales the rectangle when the mouse is actually moving. If the mouse is still, it does nothing. Does anyone know of a way I could scale the size of the rectangle based on a keyboard press whether the mouse was in motion or not? Or perhaps someone could suggest a more elegant way to approach the problem. Here is a small sample of my code, it works best in the top view only right now.
tool rectangleCreator
(
on start do
(
global t = rectangle width:1000 length:1000
)
on freemove do
(
t.pos = ((gw.getPointOnCP mouse.pos) * (getCPTM()))
completeRedraw()
if ctrlKey then
(
t.width = (t.width + 100)
t.length = (t.length + 100)
)
)
)
startTool rectangleCreator
Thanks, Jon