Game Development Community

OnMouseDown problem

by Luis Anton Rebollo · in Torque Game Engine · 03/07/2005 (3:55 pm) · 6 replies

Hi all.

I'm trying to make a guiclass with cursor derived from GameTSCtrl., but onMouseDown no execute. OnMouseMove work well.

Any idea?

thx in advance & sorry for my bad english.

#1
03/08/2005 (1:17 am)
This is how I read your problem:

You have created a subclass of GameTSCtrl. When you use that class, your onMouseMove override seems to work fine, but onMouseDown never gets called.

Is that correct?
#2
03/08/2005 (2:05 am)
Thx for the reply... :)

i'm a few stupid. I'm using starter.fps for test my class and in defaul.bind.cs -> (mouse,mouse0, mouse fire).

Action map respond and never call onmousedown.
#3
03/08/2005 (2:24 am)
:( these are not the only prob...

Andrew you are correct.

any idea?
#4
03/08/2005 (3:56 am)
OK, GuiShapeNameHud eats my click.

I make a very simple hack to solve this:

in engine/game/fps/guiShapeNameHud.cc

void GuiShapeNameHud::onMouseDown(const GuiEvent &event)
{
	static GuiTSCtrl *_guitspatent = dynamic_cast<GuiTSCtrl*>(getParent());
	_guitspatent->onMouseDown(event);
    
}

and add method declaration to fuction.

Is very simple to extend...

void GuiShapeNameHud::onMouseUp(const GuiEvent &event)
{
	static GuiTSCtrl *_guitspatent = dynamic_cast<GuiTSCtrl*>(getParent());
	_guitspatent->onMouseUp(event);
    
}
#5
06/08/2008 (3:24 pm)
Having the exact same problem.. I have a mouseTracker class that derives from guiTSCtrl and it has onMouseMove events but no onMouseDown events
#6
06/09/2008 (9:29 am)
Likely there is a higher-level GUI "on top" of yours that is consuming the input events. You can either modify the source code of the higher-level GUI to pass mouse events on to the parent (as above) or change its profile to "GuiModelessProfile."