Hello,
one idea: in your actual implementation you invoke the function DriveKeyboardHitting() with 1 in its last parameter. This indicates the 'press' event. In practice, however, you should also signal the event when the button is released again. The simplest would be following adaptation:
if ( EwBspGetButton1Level() == 1 )
{
events |= CoreRoot__DriveKeyboardHitting( RootObject, CoreKeyCodeUser1, 0, 1 );
events |= CoreRoot__DriveKeyboardHitting( RootObject, CoreKeyCodeUser1, 0, 0 );
}
if ( EwBspGetButton2Level() == 1 )
{
events |= CoreRoot__DriveKeyboardHitting( RootObject, CoreKeyCodeUser2, 0, 1 );
events |= CoreRoot__DriveKeyboardHitting( RootObject, CoreKeyCodeUser2, 0, 0 );
}
if ( EwBspGetButton3Level() == 1 )
{
events |= CoreRoot__DriveKeyboardHitting( RootObject, CoreKeyCodeUser3, 0, 1 );
events |= CoreRoot__DriveKeyboardHitting( RootObject, CoreKeyCodeUser3, 0, 0 );
}
Without this adaptation, when you press the same harwdare button twice, the GUI framework will interpret the second press event as repeatition event. This repetition event will then be delivered to the Key Press Handler which has received the initial press event. This could explain why you don't get the event in the second screen.
Does it solve the issue?
The above adaptation is sufficient for most cases as long as you are not interested in processing events when the user presses and holds a key. In such case it would be reasonable to adapt the interface to the hardware buttons so that it can detect the press and release events and report these individually.
Best regards
Paul Banach