Please HELP!!! (phindow bug...interpreting keyboard event)

I have 3 Pt_Text widgets, when Pt_text_1 widget gets a
down arrow key board event, it give focus to Pt_text_2, then when Pt_text_2
gets a down arrow key board event, it gives focus to Pt_text_3, this
allworks fine
under Qnx.

However, When I phindow to this app… when Pt_text_1 widget gets a
down arrow key board event, it give focus to Pt_text_2, but somehow it
run’s Pt_text_2’s raw keyboard event also, and shift the focus to
Pt_text_3…

This seems to be a major phindow bug, somehow phindow thinks there are 2
keyboard event occurred…code are as folloing:

int PtText_1( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t
cbinfo )
{ /
eliminate ‘unreferenced’ warnings */
widget = widget, apinfo = apinfo, cbinfo = cbinfo;
if (((PhKeyEvent_t *) PhGetData(cbinfo->event ))->key_sym == Pk_Down)
{ PtContainerFocusNext(widget, NULL);
cout << “PtText_1 DownKey is hit”<< endl;
}
return( Pt_CONTINUE );


}

int PtText_2( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t
cbinfo )
{ /
eliminate ‘unreferenced’ warnings */
widget = widget, apinfo = apinfo, cbinfo = cbinfo;
if (((PhKeyEvent_t *) PhGetData(cbinfo->event ))->key_sym == Pk_Down)
{ PtContainerFocusNext(widget, NULL);
cout << “PtText_2 DownKey is hit”<< endl;
}
return( Pt_CONTINUE );


}

Hi Ran

Before you check for the key_sym you need to test for the key
presses…For example :

PhKeyEvent_t key_data = NULL;
if (cbinfo->event->type == Ph_EV_KEY)
{
key_data = PhGetData(cbinfo->event);
/
The following test will check to see if it is a valid Sym and also
check for key stroke being down. */
if ((key_data->key_flags & Pk_KF_Sym_Valid) &&
PkIsKeyDown(key_data->key_flags)))
{
if ( key_data->key_sym == Pk_Down )
{
/*Do something */
}
}
}

Hope this helps
Regards
Brenda


ran zhang wrote:

I have 3 Pt_Text widgets, when Pt_text_1 widget gets a
down arrow key board event, it give focus to Pt_text_2, then when Pt_text_2
gets a down arrow key board event, it gives focus to Pt_text_3, this
allworks fine
under Qnx.

However, When I phindow to this app… when Pt_text_1 widget gets a
down arrow key board event, it give focus to Pt_text_2, but somehow it
run’s Pt_text_2’s raw keyboard event also, and shift the focus to
Pt_text_3…

This seems to be a major phindow bug, somehow phindow thinks there are 2
keyboard event occurred…code are as folloing:

int PtText_1( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t
cbinfo )
{ /
eliminate ‘unreferenced’ warnings */
widget = widget, apinfo = apinfo, cbinfo = cbinfo;
if (((PhKeyEvent_t *) PhGetData(cbinfo->event ))->key_sym == Pk_Down)
{ PtContainerFocusNext(widget, NULL);
cout << “PtText_1 DownKey is hit”<< endl;
}
return( Pt_CONTINUE );


}

int PtText_2( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t
cbinfo )
{ /
eliminate ‘unreferenced’ warnings */
widget = widget, apinfo = apinfo, cbinfo = cbinfo;
if (((PhKeyEvent_t *) PhGetData(cbinfo->event ))->key_sym == Pk_Down)
{ PtContainerFocusNext(widget, NULL);
cout << “PtText_2 DownKey is hit”<< endl;
}
return( Pt_CONTINUE );


}




\

your code works in phindow! thanks alot…
by the way, any idea on when the next release for phindow going to be?
I realy need a version that fixed the bug 8299, (cltr-alt-delete key
disables the hotkeys).
thank u again.


ran zhang <rzhang@vamcointernational.com> wrote in message
news:a630se$k9l$1@inn.qnx.com

I have 3 Pt_Text widgets, when Pt_text_1 widget gets a
down arrow key board event, it give focus to Pt_text_2, then when
Pt_text_2
gets a down arrow key board event, it gives focus to Pt_text_3, this
allworks fine
under Qnx.

However, When I phindow to this app… when Pt_text_1 widget gets a
down arrow key board event, it give focus to Pt_text_2, but somehow it
run’s Pt_text_2’s raw keyboard event also, and shift the focus to
Pt_text_3…

This seems to be a major phindow bug, somehow phindow thinks there are 2
keyboard event occurred…code are as folloing:

int PtText_1( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t
cbinfo )
{ /
eliminate ‘unreferenced’ warnings */
widget = widget, apinfo = apinfo, cbinfo = cbinfo;
if (((PhKeyEvent_t *) PhGetData(cbinfo->event ))->key_sym == Pk_Down)
{ PtContainerFocusNext(widget, NULL);
cout << “PtText_1 DownKey is hit”<< endl;
}
return( Pt_CONTINUE );


}

int PtText_2( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t
cbinfo )
{ /
eliminate ‘unreferenced’ warnings */
widget = widget, apinfo = apinfo, cbinfo = cbinfo;
if (((PhKeyEvent_t *) PhGetData(cbinfo->event ))->key_sym == Pk_Down)
{ PtContainerFocusNext(widget, NULL);
cout << “PtText_2 DownKey is hit”<< endl;
}
return( Pt_CONTINUE );


}



\