cancel
Showing results for 
Search instead for 
Did you mean: 

Keyboard Efficiency

Priyank
Associate II

 Hello, I was hoping for some help on which way to use a keyboard on TouchGFX. It will be the same keyboard from the example provided by TouchGFX. My application has multiple screens (10-12) where it uses a keyboard. Would it be more efficient memory/gpu wise to

  1. overlay a keyboard on every screen and use setVisible true/false for when user wants keyboard opened
  2. create one screen for the keyboard and whenever the user wants to use the keyboard it goes to that screen

I was a bit confused because I know it takes resources for the screen to draw the keyboard images and the mappings, so I thought using one screen would be more efficient. But, TouchGFX loses the state and destroys the screen that it leaves, meaning using one screen would be constant redraws, not to mention carrying over state and managing buffers so the keyboard can send data back to the screen where user came from

Is there a "norm" when it comes to using keyboard on TouchGFX?

4 REPLIES 4
GaetanGodart
ST Employee

Hello @Priyank and welcome to the community! :smiling_face_with_smiling_eyes:

 

Both options are viable.

I assume you have a small screen so that the keyboard would take most of the space. In that case, the computing power required to invalidate and redraw the screen would be similar when changing to a completely different screen (option 2) and when invalidating most of the screen (option 1).

When you change screen you do "loose the current state". To fix that, you should store the state in the model.ccp file and use this state data to setup your screen properly when it is created/re-created.
Please find a tutorial here : Application with multiple screens 

 

I hope this helps! 
If this comment answers your question, I invite you to select it as "best answer".

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Thank you,

I am guessing applications such as mine are somewhat common. Do you know what best practice would be in this situation?

There is never an single answer to fit all projects. Each solution have ups and downs.

If you want something simple to design, just add the keyboard to each of the screen that uses it and set it visible or invisible as you need.
If you want to save memory, create a separate screen and use the MVP to propagate your datas.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Hello @Priyank ,

 

Have you been able to move forward with your question?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)