RC1: Mouse binding not working
by Mike Lilligreen · in Torque Game Builder · 06/01/2006 (10:03 am) · 3 replies
I followed the setup mentioned in the Input Interaction PDF for using .bind with mouse0 with the example xaxis function. However, xaxis (or buttons) are not providing any feedback regardless of whether the level editor is enabled or not.
Anything keyboard related works fine and the console sees mouse0 when the window loses/regains focus.
Is there something I am missing getting this to work via script or was mouse binding disabled in favor of using callbacks exclusively?
Anything keyboard related works fine and the console sees mouse0 when the window loses/regains focus.
Is there something I am missing getting this to work via script or was mouse binding disabled in favor of using callbacks exclusively?
About the author
#2
Try this:
You should get the mouse X value spammed into the console. Note that if you open the console, it will showCursor, so you might want to do something to avoid this, like checking if the cursor is visible in your main loop.
Hope this helps.
02/08/2007 (11:38 am)
Hi, Gustavo. You need to call hideCursor to get input directly from the mouse.Try this:
hideCursor(); moveMap.bind( mouse0, "xaxis", "mouseX"); moveMap.bind( mouse0, "yaxis", "mouseY");
function mouseX(%val)
{
echo(%val);
}You should get the mouse X value spammed into the console. Note that if you open the console, it will showCursor, so you might want to do something to avoid this, like checking if the cursor is visible in your main loop.
if (Canvas.isCursorOn())
hideCursor();Hope this helps.
#3
02/08/2007 (12:52 pm)
Hi Thomas! Thank you very much, it worked very well!
Torque Owner Gustavo Boni
But i dont get any feedback. I notice that my mouse icon is beeing rendered in the game, before it was not.
Is this a bug?