HANDLERDESC Prob | developer.brewmp.com HANDLERDESC Prob | developer.brewmp.com

Developer

HANDLERDESC Prob

Hi All,
I have a serious problem. The problem is described below:

form1(pMe)
{
HANDLERDESC_Init(&pMe->Form1Handler, Form1_HandleEvent, pMe, NULL);
IFORM_SetHandler(pMe->Form1, &pMe->Form1Handler);

static boolean Form1_HandleEvent(pMe,...)
{
switch(wParam)
{
case AVK_SELECT:
form2(pMe)
}

form2(pMe)
{
HANDLERDESC_Init(&pMe->Form2Handler, Form2_HandleEvent, pMe, NULL);
IFORM_SetHandler(pMe->Form2, &pMe->Form2Handler);

static boolean Form2_HandleEvent(pMe,...)
{
switch(wParam)
{
case AVK_SELECT:
form3(pMe)
}

Problem is if I press "OK"(when I am in form1) once it is directly moving to form3. But I want to press "OK" twice to move at form3. How can I do this using the same code flow? Please help me.

Hello
you have to use any one of the EVT_KEY_PRESS , EVT_KEY, EVT_RELEASE event
and return other 2.
The code becomes like this :
form1(pMe)
{
HANDLERDESC_Init(&pMe->Form1Handler, Form1_HandleEvent, pMe, NULL);
IFORM_SetHandler(pMe->Form1, &pMe->Form1Handler);

static boolean Form1_HandleEvent(pMe,...)
{
switch(eCode)
{
case EVT_KEY:
case EVT_KEY_RELEASE:
return TRUE;
case EVT_KEY_PRESS:
switch(wParam)
{
case AVK_SELECT:
form2(pMe)
}
}

form2(pMe)
{
HANDLERDESC_Init(&pMe->Form2Handler, Form2_HandleEvent, pMe, NULL);
IFORM_SetHandler(pMe->Form2, &pMe->Form2Handler);

static boolean Form2_HandleEvent(pMe,...)
{
switch(eCode)
{
case EVT_KEY:
case EVT_KEY_RELEASE:
return TRUE;
case EVT_KEY_PRESS:
switch(wParam)
{
case AVK_SELECT:
form3(pMe)
}
}

I hope this will solve the problem :rolleyes:
Lalitkumar

Hello
you have to use any one of the EVT_KEY_PRESS , EVT_KEY, EVT_RELEASE event
and return other 2.
The code becomes like this :
form1(pMe)
{
HANDLERDESC_Init(&pMe->Form1Handler, Form1_HandleEvent, pMe, NULL);
IFORM_SetHandler(pMe->Form1, &pMe->Form1Handler);

static boolean Form1_HandleEvent(pMe,...)
{
switch(eCode)
{
case EVT_KEY:
case EVT_KEY_RELEASE:
return TRUE;
case EVT_KEY_PRESS:
switch(wParam)
{
case AVK_SELECT:
form2(pMe)
}
}

form2(pMe)
{
HANDLERDESC_Init(&pMe->Form2Handler, Form2_HandleEvent, pMe, NULL);
IFORM_SetHandler(pMe->Form2, &pMe->Form2Handler);

static boolean Form2_HandleEvent(pMe,...)
{
switch(eCode)
{
case EVT_KEY:
case EVT_KEY_RELEASE:
return TRUE;
case EVT_KEY_PRESS:
switch(wParam)
{
case AVK_SELECT:
form3(pMe)
}
}

I hope this will solve the problem :rolleyes:
Lalitkumar

Thank u Lalit. Ya it is working...... :)
Lalit wrote:Hello
you have to use any one of the EVT_KEY_PRESS , EVT_KEY, EVT_RELEASE event
and return other 2.
The code becomes like this :
form1(pMe)
{
HANDLERDESC_Init(&pMe->Form1Handler, Form1_HandleEvent, pMe, NULL);
IFORM_SetHandler(pMe->Form1, &pMe->Form1Handler);

static boolean Form1_HandleEvent(pMe,...)
{
switch(eCode)
{
case EVT_KEY:
case EVT_KEY_RELEASE:
return TRUE;
case EVT_KEY_PRESS:
switch(wParam)
{
case AVK_SELECT:
form2(pMe)
}
}

form2(pMe)
{
HANDLERDESC_Init(&pMe->Form2Handler, Form2_HandleEvent, pMe, NULL);
IFORM_SetHandler(pMe->Form2, &pMe->Form2Handler);

static boolean Form2_HandleEvent(pMe,...)
{
switch(eCode)
{
case EVT_KEY:
case EVT_KEY_RELEASE:
return TRUE;
case EVT_KEY_PRESS:
switch(wParam)
{
case AVK_SELECT:
form3(pMe)
}
}

I hope this will solve the problem :rolleyes:
Lalitkumar

Thank u Lalit. Ya it is working...... :)
Lalit wrote:Hello
you have to use any one of the EVT_KEY_PRESS , EVT_KEY, EVT_RELEASE event
and return other 2.
The code becomes like this :
form1(pMe)
{
HANDLERDESC_Init(&pMe->Form1Handler, Form1_HandleEvent, pMe, NULL);
IFORM_SetHandler(pMe->Form1, &pMe->Form1Handler);

static boolean Form1_HandleEvent(pMe,...)
{
switch(eCode)
{
case EVT_KEY:
case EVT_KEY_RELEASE:
return TRUE;
case EVT_KEY_PRESS:
switch(wParam)
{
case AVK_SELECT:
form2(pMe)
}
}

form2(pMe)
{
HANDLERDESC_Init(&pMe->Form2Handler, Form2_HandleEvent, pMe, NULL);
IFORM_SetHandler(pMe->Form2, &pMe->Form2Handler);

static boolean Form2_HandleEvent(pMe,...)
{
switch(eCode)
{
case EVT_KEY:
case EVT_KEY_RELEASE:
return TRUE;
case EVT_KEY_PRESS:
switch(wParam)
{
case AVK_SELECT:
form3(pMe)
}
}

I hope this will solve the problem :rolleyes:
Lalitkumar