I have been going through the API and trying some things for over an hour and searched the forums trying to find an answer to my problem but just can't find much.
Anyhow I have made an edit box and played around with it and the event receiver. But anyhow here is what I am trying to do. I want to mimic the behavior of clicking on the box with a key event.
So for example I start my program I can click on the edit box and start typing in it.
What I want is to start my program and instead of clicking on the box I want to say hit the 'c' key and it will the activate the box so I can start typing in it.
So playing around with the event receiver I can grab the 'c' key event.
When i grab the event for the 'c' key event I want to create a new event within the code to mimic clicking on the edit box which believe I can figure out but what I can not figure out is how to take my new SEvent and throw that into the engine.
Here is an example of what I am trying to figure out
if (event.EventType == EET_KEY_INPUT_EVENT && event.KeyInput.PressedDown && event.KeyInput.Key == KEY_KEY_C)
{
SEvent temp;
temp.xxxx = xxxxx //Fill in the needed info for the new event(should be able to figure this out myself)
return ???.???(temp)
}
So I am looking for what I can call within the engine for the new event.
create an Event
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Code: Select all
gui::IGUIEnvironment* gui = device->getGUIEnvironment();
//...
gui::IGUIElement* root = gui->getRootGUIElement();
if (root) {
gui::IGUIElement* box = root->getElementFromId(MY_EDITBOX_ID, true);
if (box)
gui->setFocus(box);
}