Jump to content

Textedit event to display a virtual keyboard


GarblingTeam

Recommended Posts

Hello there,

We have to develop onboard an HMI with  several elements including a textedit widget which is used to type numerical value. To this aim, we have developed a virtual keyboard with only numerical values and what we would like to do now is to make it appear by clicking on the textfield area. The problem is that, we noticed that no event is associated with the textedit widget in the gwin_textedit.h file whereas such event is implemented in the gwin_keyboard.h file as shown below:

#define GEVENT_GWIN_KEYBOARD    (GEVENT_GWIN_CTRL_FIRST+6)
   35 
   36 /**
   37  * @brief A Keyboard Event
   38  * @note  There are currently no GEventGWinButton listening flags - use 0 as the flags to @p gwinAttachListener()
   39  */
   40 typedef GEventGWin    GEventGWinKeyboard;

So we would like to find a way to adapt the basic gwin_event (see quotation below) on the widget textedit. Do you think it  is possible to implement it lthis way in order to achieve our goal ?

typedef struct GEventGWin {
  150   GEventType    type;           /**< The type of this event */
  151   GHandle     gwin;           /**< The gwin window handle */
  152   #if GWIN_NEED_WIDGET && GWIN_WIDGET_TAGS
  153     WidgetTag tag;            /**< The tag (if applicable) */
  154   #endif
  155 } GEventGWin;

Thank you for your answers.

Link to comment
Share on other sites

Hello and welcome to the community!

 

1 hour ago, GarblingTeam said:

Do you think it  is possible to implement it this way in order to achieve our goal?

Implementing such behavior would require modifications of the GWIN module. There are similar ways to archive this - all of which come with their own up- and downsides. We just had a long discussion about that and came to the conclusion that it will take a lot more thinking to figure out which is the best way to give the user the ability to implement that behavior. Sadly there's also no quick work-around that we could propose as this requires changes in the GWIN module that will affect all widgets and therefore have to be thought through well.
That said it will take some time to get this done due to our current workload being quite high. If this is of high importance we'd suggest purchasing a support package to drastically speed up this process. It will give you direct access to our high-priority support ticket system.

 

1 hour ago, GarblingTeam said:

To this aim, we have developed a virtual keyboard with only numerical values

Did you see that you can use the existing virtual keyboard widget for that and just create a custom layout that only contains numbers and then assign that using gwinKeyboardSetLayout(). You can have a look at the existing layout in /src/gwin/. It's just a matter of filling in a few structs. That way you will still use the underlying, official code. If we ever change anything (eg. fix some bugs or extend the features of the keyboard widget) you can benefit from them too without changing anything!

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...