Mouse click issue
by Frederic · in Torque X 2D · 08/17/2007 (12:01 pm) · 2 replies
While trying to get the mouse working, I noticed a funny priority issue on the InputMap level:
When you register the mouse clicks using:
inputMap.BindAction(mouseId, 3, TorqueInputDevice.Action.LeftClick, leftMouseButtonDown);
inputMap.BindAction(mouseId, 3, TorqueInputDevice.Action.RightClick, rightMouseButtonDown);
inputMap.BindAction(mouseId, 3, TorqueInputDevice.Action.MiddleClick, middleMouseButtonDown);
the delegates xxxxMouseButtonDown are called while the corresponding mouse button is down.
When two buttons are held down, the calls stop (until one button is released again), EXCEPT when pressing the left and middle button down, in which case the middleMouseButtonDown is being called.
Holding down all three mouse buttons at the same time stops the calls, too.
-> The left & midlle mouse button down behaviour seems to be inconsistent in this scheme.
BTW: in the BindAction call, using 3 or 4 as the second parameter seems to make no difference. I feel I should be using some enum, but I did not find anything appropriate?
When you register the mouse clicks using:
inputMap.BindAction(mouseId, 3, TorqueInputDevice.Action.LeftClick, leftMouseButtonDown);
inputMap.BindAction(mouseId, 3, TorqueInputDevice.Action.RightClick, rightMouseButtonDown);
inputMap.BindAction(mouseId, 3, TorqueInputDevice.Action.MiddleClick, middleMouseButtonDown);
the delegates xxxxMouseButtonDown are called while the corresponding mouse button is down.
When two buttons are held down, the calls stop (until one button is released again), EXCEPT when pressing the left and middle button down, in which case the middleMouseButtonDown is being called.
Holding down all three mouse buttons at the same time stops the calls, too.
-> The left & midlle mouse button down behaviour seems to be inconsistent in this scheme.
BTW: in the BindAction call, using 3 or 4 as the second parameter seems to make no difference. I feel I should be using some enum, but I did not find anything appropriate?
#2
I have been using the wrong method.
InputMap.BindAction(mouseId, (int)XMouseDevice.MouseObjects.LeftButton, MouseDown);
works fine.
Thanks!
08/23/2007 (9:23 am)
You are right,I have been using the wrong method.
InputMap.BindAction(mouseId, (int)XMouseDevice.MouseObjects.LeftButton, MouseDown);
works fine.
Thanks!
Torque Owner rwillis
InputMap.BindAction(mouseId, (int)XMouseDevice.MouseObjects.LeftButton, MouseDown);