cancel
Showing results for 
Search instead for 
Did you mean: 

Keyboard implementation shows the correct image that is set as highlightBitmap when key is pressed, but pressing a key not always results in the buffer being updated.

EKlei
Associate

EDIT - Solution was to increase key (hitbox) size, to prevent touch 'sliding' off the key before completing lifting of finger tip

Using the CustomKeyboard example provided with the TouchGFX designer v10 we have created our own implementation of the Keyboard class in the form of a numpad.

This seems to work well enough, except for the behaviour in the question description:

Pressing any of the keys will sometimes result in the key lighting up as it is supposed to do (the image that is set as highlightBitmap is shown), but the value associated with the pressed key (e.g. '1' or '5') is not added to the buffer (which is not at it's maximum amount of characters yet). Pressing of the same key will either show the same behaviour again, or suddenly work as it is supposed to. The behaviour is not reliably repeatable.

Example:

  • Buffer is showing its initial value of '0'
  • '1' is pressed
    • highlightBitmap is shown for '1' key
    • Buffer changes to '1'
  • '2' is pressed
    • highlightBitmap is shown for '2' key
    • Buffer changes to '12'
  • '3' is pressed
    • highlightBitmap is shown for '3' key
    • Buffer remains '12'
  • '3' is pressed
    • highlightBitmap is shown for '3' key
    • Buffer remains '12'
  • '3' is pressed
    • highlightBitmap is shown for '3' key
    • Buffer changes to '123'
  • '3' is pressed
    • highlightBitmap is shown for '3' key
    • Buffer changes to '1233'

We first experienced this behaviour while having used the Keyboard::setKeyListener() function to set our own callback function to be called in case of a key press.

However, even removing any reference to this custom callback (i.e. letting the Keyboard class be the only code to handle the key press and performing any actions on the keyboard buffer), we still experience the described behaviour.

Could you please help us figure out what exactly is going wrong and, especially, help us fix the issue?

3 REPLIES 3
Martin KJELDSEN
Chief III

Hi @EKlei​,

Are you able to share the project with me?

/Martin

EKlei
Associate

Hi Martin,

Thanks for getting back to me!

I think I resolved the issue myself: By making the keys on the keyboard larger, everything seems to be alright.

My guess is that a touch on a key starts out to register within the hitbox for that key, so the highlightBitmap is displayed by TouchGFX. Then, while releasing the touch, lifting the finger off the display actually makes the point of touch change slightly due to the finger tip not being an absolute point. This can cause the point of touch to move out of the hitbox for the key that was pressed before the finger leaves the touchscreen. In that case, TouchGFX does not register this as a keypress while the user did expect it to.

This is completely due to the size of the keys and fingertips, and has nothing to do with any problem in the code itself.

So, again, thank you very much for reaching out to support us in this case, but it turns out to be our own fault, as it so often is.. 😉

With kind regards,

Emiel

Hi Emiel,

Glad you figured it out. Makes sense. It can be tricky to find the correct root cause for sure. And it's natural to doubt the underlying software which is also often not without flaws 😉

/Martin