cancel
Showing results for 
Search instead for 
Did you mean: 

Pausing function during keyboard input

Kenbit
Associate

Hi 

I am using the TouchGFX keyboard to input data into fields on a number of settings screens. Since the screens are small, I cannot afford the option of Cancel and Enter buttons as used in the demo. Instead I have added 2 buttons to the keyboard for Enter and Cancel. The former leaves the buffer intact, while the latter clears it before returning. However, the function that contains the keyboard container continues executing while the keyboard is in use. The result is that the data is never entered into the field. 

One workaround I have used is to add an 'Add/Edit' flex button  that loads the keyboard and writes the returned buffer to the model. Flex buttons over the data fields, that are made visible at the time the keyboard container is loaded, then cause the screen to reload, which then draws and displays the data from the model. It works, but it is too clunky.

I have tried using a while loop to pause while the keyboard is visible, but this does nothing.

Has anyone any suggestions on how to pause the code until the user has finished entering data via the keyboard? I'm probably missing something extremely obvious.

 

24 REPLIES 24

I did, but I customised it to handle and display up to 100 characters. I also shortened the space bar to accommodate a cancel X button and an enter tick button that hide the keyboard. The remainder of the code is the same. In the online example code, the keyboard sits between buttons on the screen, so no attempt is made to enter text into textAreas until one of them is pressed. This hides the keyboard and populates the textArea. My problem is I hide the keyboard from within the keyboard code, but cannot copy to the textArea on the screen from there. 
Ken

funky
Associate III

can you upload your project somewhere and make it runnable in the simulator?

Hi Gaetan

This is exactly what I am looking for! This gives the required user experience. Yes, I can extend this to also write to the model. 

Many thanks

Ken

GaetanGodart
ST Employee

Great to hear! :smiling_face_with_smiling_eyes:

Don't hesitate if you have other TouchGFX questions !

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

The code is now updated and working exactly as I wanted, with all five textAreas filling and data saving to the model. Now I just need to see how to get the keyboard working with 2 screens. Another day.

Thanks Again

Ken