57 views
in GUI Development by
My system has a keypad controller for which I have implemented a device class interface for, and am reading the output of that device via calls through my instance of the device class.  I also have a KeyHandler defined in my application which will eventually perform the manipulations of the GUI based on the value of certain key selections.  What is the proper way to link the key value I receive via the "device read" to my hardware, to the "KeyHandler.Code" member of my KeyHandler?  Should I implement an System Event Handler, which when triggered, would update the KeyHandler.Code member of the KeyHandler?

Or perhaps the read of the device driver should be called directly from the EwGetKeyCommand function and use the key value just like keyboard input.

 

Thank you.

1 Answer

0 votes
by

Hi RichK,

of course, you can consider your keypad as any data source and use a device interface to feed the key events into your GUI application and use a system event handler to process the event.

Alternatively - and this is what I would like to recommend - you can use the standard key processing mechanism as it is integrated within Embedded Wizard and the Mosaic framework. This means, instead of using key events from a PC keyboard you insert the key codes received from your keypad into the GUI application. Within the GUI application you can use the provided key event handler. The big advantage: You can use the same key events during prototyping on your development PC.

Please have a look to the chapter main loop - especially to the section Processing Key Events.

Depending on the Build Environment you are using as template, you will find a main loop in ewmain.c which uses key events received via serial connection. You can remove the serial key event reception and use your keypad instead.

Hope this helps...

Best regards,
Manfred.

Embedded Wizard Website | Privacy Policy | Imprint

...