OnEvent problem
Posted: Fri Oct 05, 2007 2:59 pm
So i added some code to mode a node in the OnEvent function, but my code cannot accept events on the same time, like when i push up and then left, and i dont undestand what i am doing wrong.
Here is a sample of the code:
bool CDemo::OnEvent(SEvent event)
{
if (!device)
return false;
if (event.EventType == EET_KEY_INPUT_EVENT &&
event.KeyInput.Key == KEY_ESCAPE &&
event.KeyInput.PressedDown == false)
{
// user wants to quit.
if (currentScene < 3)
timeForThisScene = 0;
else
device->closeDevice();
}
if (model1 != 0 && event.EventType == EET_KEY_INPUT_EVENT && (event.KeyInput.Key == KEY_KEY_O || event.KeyInput.Key == KEY_KEY_K
|| event.KeyInput.Key == KEY_KEY_L || event.KeyInput.Key == KEY_KEY_M || event.KeyInput.Key == KEY_KEY_J) && event.KeyInput.PressedDown)
{
and then i use a switch:
switch(event.KeyInput.Key)
{
case KEY_KEY_O:
{
Here is a sample of the code:
bool CDemo::OnEvent(SEvent event)
{
if (!device)
return false;
if (event.EventType == EET_KEY_INPUT_EVENT &&
event.KeyInput.Key == KEY_ESCAPE &&
event.KeyInput.PressedDown == false)
{
// user wants to quit.
if (currentScene < 3)
timeForThisScene = 0;
else
device->closeDevice();
}
if (model1 != 0 && event.EventType == EET_KEY_INPUT_EVENT && (event.KeyInput.Key == KEY_KEY_O || event.KeyInput.Key == KEY_KEY_K
|| event.KeyInput.Key == KEY_KEY_L || event.KeyInput.Key == KEY_KEY_M || event.KeyInput.Key == KEY_KEY_J) && event.KeyInput.PressedDown)
{
and then i use a switch:
switch(event.KeyInput.Key)
{
case KEY_KEY_O:
{