how to trigger the altcommand
by Nelson A. K. Gonsalves · in Torque Game Engine · 10/02/2001 (11:56 am) · 6 replies
I always supposed the altcommand was a left mouse click till I actualy used it and nothing happened... lol
seriously.... how to trigger it?
seriously.... how to trigger it?
About the author
#2
add the following line to guiBitmapCtrl.h
virtual void onRightMouseUp(const GuiEvent &event);
and add the following lines to guiBitmapCtrl.cc
void GuiBitmapCtrl::onRightMouseUp(const GuiEvent &)
{
//if we released the mouse within this control, perform the action
if (cursorInControl())
{
//execute the console command
if (mAltConsoleCommand[0])
{
char buf[16];
dSprintf(buf, sizeof(buf), "%d", getId());
Con::setVariable("$ThisControl", buf);
Con::evaluate(mAltConsoleCommand, false);
}
else
Con::executef(this, 1, "onAction");
}
}
10/07/2001 (5:21 pm)
This is a Quick Tutorial to map the altcommand of a bitmap to a right mouse click, Hope that someone finds it useful.add the following line to guiBitmapCtrl.h
virtual void onRightMouseUp(const GuiEvent &event);
and add the following lines to guiBitmapCtrl.cc
void GuiBitmapCtrl::onRightMouseUp(const GuiEvent &)
{
//if we released the mouse within this control, perform the action
if (cursorInControl())
{
//execute the console command
if (mAltConsoleCommand[0])
{
char buf[16];
dSprintf(buf, sizeof(buf), "%d", getId());
Con::setVariable("$ThisControl", buf);
Con::evaluate(mAltConsoleCommand, false);
}
else
Con::executef(this, 1, "onAction");
}
}
#3
10/12/2001 (2:52 am)
If you mean as in alt firing, the bind is commented out. It also appears to fire whatever's in slot 1, rather than the usual 0 for weapons.
#4
10/12/2001 (7:11 am)
No... I mean right clicking on a bitmap on the gui...
#5
Thanks!
02/13/2006 (8:02 am)
The code didn't seem to work when I added it to "GuiBitmapCtrl::onRightMouseUp" but worked nicely when I added it to "GuiControl::onRightMouseUp." Thanks!
#6
09/27/2008 (10:36 am)
AltCommand is Double-Click
Torque Owner Tim Gift