Bind call not detecting mouse clicks
by Rob Segal · in Torque Game Engine · 05/08/2006 (8:02 pm) · 3 replies
I have no idea why but I cannot get any mouse clicks to be detected from setting mouse clicks up in an action map. First I make a call with my action map to setup the mouse clicks...
moveMap.bind(mouse0, "button0", "mouseClick");
Then I deckare the function to catch the mouse clicks...
function mouseClick(%val)
{
echo("Left mouse button press!");
}
Makes sense right? But I don't see and messages echoed out to the console screen. Any thoughts? I don't see any messages in the log but I'm thinking maybe the logging level is down to low so I don't notice anything.
moveMap.bind(mouse0, "button0", "mouseClick");
Then I deckare the function to catch the mouse clicks...
function mouseClick(%val)
{
echo("Left mouse button press!");
}
Makes sense right? But I don't see and messages echoed out to the console screen. Any thoughts? I don't see any messages in the log but I'm thinking maybe the logging level is down to low so I don't notice anything.
#2
05/08/2006 (8:52 pm)
By default button0 on the mouse is bound to mouseFire. This is why your mouseClick function is not working when bound to the moveMap yet works when bound within the GloabalActionMap. To solve removemoveMap.bind( mouse, button0, mouseFire );from default.bind.cs and delete the config.cs file from the client folder to ensure Torque picks up your new binding.
#3
05/09/2006 (12:17 pm)
Ok sorry my fault I actually meant to post this in regards to TGB not TGE. However your suggestion did seem to work for TGB Tim so thanks. While I'm here though I am kind of curious about joystick key detection. Do I have to do anything special for joystick setup or should it be much the same as the mouse. Like this...moveMap.bind(joystick0, button0, joystickFire );
Torque Owner Rob Segal
GlobalActionMap.bind(mouse0, "button0", "mouseClick");
Things seem to work great so I don't quite know what to say. Perhaps the map I am creating is being overwritten by the global action map or some other action map?
This also makes me wonder about if there is already a command bound to a left mouse button click say perhaps in the global action map and then I delcare a line as above I assume the new declaration overrides the old?