My application on a SAMA5 processor uses a small physical keypad next to the display and I would like to create several "softkeys" that appear on the screen next to the keypad which get controlled when the physical buttons are pressed.
Each softkey would have components such as :
- a beveled perimeter that would be controlled based on the button being pressed or released
- a text field within the softkey that is updated based on the button being pressed.
- a color fill that would by controlled based on certain conditions
How can I create a single "button" component that encompasses the above attributes, and can have several instances of?
How can I control a Key Handler object via an external state transition event (boolean variable) ?
The simplest approach would be to use the ready-to-use Push Button widget. It allows you to provide own configuration and so modify the appearance and partially the behavior of the button. In practice this means: you can configure the background of the button by specifying bitmaps, the label and an icon. By using ALPHA8 bitmaps for the background of the button even the colors can be changed dynamically. For more details concerning the configuration see the section Customize your own Push Button.
If the customization supported by the above mentioned Push Button widget is not sufficient for your application case (possibly you want some particular visual effects or decorations not available in the Push Button widget), you can create your Push Button component by using the provided Push Button component template. The template, as its name indicates, gives you the necessary base functionality for Push Buttons, which then can be enhanced or modified. With this approach you are flexible. Unlike the first approach, however, you will need to write some code to implement your enhancements and modifications.
Do you want to know how to feed inputs from external hardware buttons (physical keypad)? If yes, in your build environment you will find a C function named usually EwGetKeyCommand(). You can modify this function to check the state of the physical keypad and return the corresponding Embedded Wizard key code. The Key Handler will then react to the event if the Key Handler filter condition is configured appropriately and the Key Handler lies on the focus path. See also the chapter Main Loop.
I hope it helps you further.
Ask Embedded Wizard
Welcome to the question and answer site for Embedded Wizard users and UI developers.
Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!