cancel
Showing results for 
Search instead for 
Did you mean: 

Integrate Keyboard in Custom TouchGFX Application.

AKetc
Associate III

Hello everyone,

I am trying to build a custom application for my STM32F769i-Discovery Board. The Application consists of a Login Page which will compare the input with existing database and then move to next page after authentication. I wanted help on

1) How I can integrate a keyboard in my Application where user can type username and password?

2) How to make the password encrypted and appear as dots instead of normal characters?

Any help would be highly appreciated. Thanks

14 REPLIES 14

Hello,

Have looked at the "Keyboard Example" from TouchGFX Designer?

0690X000009k0XrQAI.png

With regards,

Badreddine

AKetc
Associate III

Yes I have, I just wanna know how to make the typed characters in the keyboard appear in my text box of login screen?

Also, how to make the password appear in dotted form?

AKetc
Associate III

Can anyone please help me out?

How to integrate this keyboard into my custom GUI to edit a text box for username.

Also how to make the password appear as dots???

Martin KJELDSEN
Chief III

Hi,

What are your concrete problems? Did you try to understand the code of the keyboard? You should be able to replace the letter being shown with * in all cases (storing the real character somewhere else) - It should be apparent from the code.

/Martin

AKetc
Associate III

The concrete problems are,

1) A keyboard pops up when I press the text box(I have placed a button with trigger over here and upon that button, text will be written). I have achieved this via Show Widget Action since I have made my own Custom Keyboard Widget.

2) I have placed that custom Keyboard Widget on my Main Screen.

3) I am trying to implement a functionality where when I press the keyboard key (say for example A) on my custom widget, it overrides the text box on my Main Screen with the character pressed.

4) I adopted a callback approach for this linking the buttoncallback on custom keyboard widget with a callback I created on my Main Screen.

5) The code compiles fine however as soon as I launch the simulator and press the key on custom keyboard, the Simulator crashes. I did some printf debugging and found out that the code gets stuck at " if (callback -> isValid()) " part of the code and I can't understand how to fix this.

6) I understood your point of using * in place of real character. Thanks for this. Please also respond to the above problem. I shall be very thankful.

Martin KJELDSEN
Chief III

So you're not getting an assert popup? Did you set a callback? Usually it would be

if( callback !=0 && callback->isValid() )
{ ... }

So if you haven't set a callback i'm sure the code would just crash since your pointer is uninitialized. That's a "mistake" in the keyboard to not guard for null pointers before dereferencing.

/Martin

AKetc
Associate III

Yes I have set up a callback. Basically, I am using the callback generated by GUI Interaction. In that buttonhandlercallback, I have called a virtual function. In my code, I am using that virtual function and checking the assert popup condition inside that virtual function.

Do you mean I can't use the gui generated callback's function directly? What could be the other approach then?​

Martin KJELDSEN
Chief III

There's no reason why you shouldn't be able to do that, but you need to initialize the callback to point to that specific handler. I don't think the application should crash, though, if you have not bound a handler to the callback:

e.g. default init of a callback

MyView::MyView() :
    callback(this, &MyView::callbackHandler)
{ ... }

/Martin

AKetc
Associate III

Let me post my code snippets for a better explanation of my query.

I have a Custom Container named CustomKeyboardWidget. The respective .hpp and .cpp files are attached below.

The GUI prints "Clicked Outside" and as soon as if (viewCallback->isValid()) condition is entered, the GUI crashes.

The key_1press function is a virtual function automatically created by the GUI whenever key_1 on keyboard is pressed.

0690X00000ApO4nQAF.png

0690X00000ApO4sQAF.png