Hello Michal,
think on the buttons as if they were keyboard keys. With the Key Press Handler you can react to keyboard events.
The remaining question is, how to feed the events when the user presses a button. This is an aspect you have to implement in the main loop by explicitly invoking the function CoreRoot__DriveKeyboardHitting() every time you detect taht the user has pressed/released a button.
You can, for exampe, map the four buttons to the keys User1, User2, User3 and User4 (see also). Then when you detect in the main loop that the user has pressed or released the first button, you call the function CoreRoot__DriveKeyboardHitting() as demonstrated below:
if ( Button_1_Pressed )
events |= CoreRoot__DriveKeyboardHitting( rootObject, CoreKeyCodeUser1, 0, 1 );
if ( Button_1_ReLeased )
events |= CoreRoot__DriveKeyboardHitting( rootObject, CoreKeyCodeUser1, 0, 0 );
SimIlarly, you call the functions when other buttons are pressed/released by using the corresponding key codes. Once the function is called, the corresponding event is propagated through the GUI application to the actually focused GUI component and there it can be processed.
Best regards
Paul Banach