Hi,
I have aan application that is using touch screen.And I am using Irrlicht for the GUI development of my app. Now since I have to use only the touch screen (as a user interface), so I am simulating my touch events into mouse events and passing them to irrlicht device.
The touch screen driver generates the X and Y coodinate for me and I send these to my function and therefore to Irrlicht by the following way:
///////////////////
event.EventType = irr::EET_MOUSE_INPUT_EVENT;
event.MouseInput.X = x;
event.MouseInput.Y = y;
event.MouseInput.Event = irr::EMIE_LMOUSE_PRESSED_DOWN;
env->postEventFromUser(event);
event.MouseInput.Event = irr::EMIE_LMOUSE_LEFT_UP;
env->postEventFromUser(event);
///////////////////
The problem is that I can not see the button being pressed.though the action associated with the press of the button is executed fine.
Any idea where I am wrong ?
Button Press Problem
-
manik_sheeri
- Posts: 53
- Joined: Tue May 19, 2009 12:18 am
Re: Button Press Problem
IGUIButton will draw the pressed state when it receives EMIE_LMOUSE_PRESSED_DOWN. When it receives EMIE_LMOUSE_LEFT_UP, it executes the button and draws the normal state. If you are sending both of those events immediately after each other, the engine will never draw the pressed state as EMIE_LMOUSE_LEFT_UP will return the button to its normal state.manik_sheeri wrote:event.MouseInput.Event = irr::EMIE_LMOUSE_PRESSED_DOWN;
env->postEventFromUser(event);
event.MouseInput.Event = irr::EMIE_LMOUSE_LEFT_UP;
env->postEventFromUser(event);
///////////////////
The problem is that I can not see the button being pressed.though the action associated with the press of the button is executed fine.
Either add a sufficient delay between the two events so at least one draw cycle happens, or change your touch screen code to only issue EMIE_LMOUSE_LEFT_UP when the user removes their finger.
-
manik_sheeri
- Posts: 53
- Joined: Tue May 19, 2009 12:18 am