Hello Mariam,
in principle you can implement a Device Class in order to provide 'button pressed' events to your application.
Since you want to use these button pressed events as regular key events (e.g. to navigate within your GUI application) you should better use the provided infrastructure for keyboard events.
The advantage is: You can easily test your GUI application within the Prototyper by using key events.
Please have a look into the main loop documentation section processing key events. The idea is that within your main loop you can check the hardware buttons and insert a regular key event as soon as a button is pressed.
Best regards,
Manfred.