Game Development Community

Trapping MouseMove Events to Specific GUIControl

by GrantleyDay · in Torque X 2D · 09/19/2007 (1:40 am) · 3 replies

I am having trouble trapping MouseMove events to a specific GUIControl, trying both GUIButton and GUIBitmap, incase one does work.

For example:

GUIBitmap test = new GUIBitmap();
//setup test (Bitmap, Position, Size, Visible, Folder, Active etc

then:

test.InputMap.BindAction(mouseID, (int)XMouseDevice.MouseObjects.X, TrapMouseMove);

So it works very weird. Bascially it doesn't recieve input, unless you pass focus to the control, and then it recieves input from anywhere in the Scene, all input is directed to TrapMouseMove.

This doesn't seem right, shouldn't the InputMap only trap the MouseMove events when the mouse is actually within the control?

Am I doing something wrong?

Thanks in advance!

#1
09/21/2007 (3:02 pm)
You're not doing anything wrong, that's just how the GUI works. A GUI control will only receive input when it has focus. The mouse support in the engine is not very robust, to say the least.
#2
09/24/2007 (12:20 am)
Found Some great resources on the other public Torque X thread.

Thanks for your help!
#3
09/27/2007 (5:27 pm)
I am in need of some related info, can you link the thread pls?