2020-05-20 10:54 AM
Hey,
I'm working on custom board Touchgfx project and I'm using Keyboard widget for text input. During testing I found out that keyboard Cancel event is not working properly.
Description of problem:
When i click and hold on one of keys and drag out of this area the keyboard cancels event and nothing happens as expected. But when i click again on any other or same key and release it in area of this key nothing happens again ( here i would expect that belonging character is written in text buffer). Keyboard starts working normal after second press and release.
I tried it also in Keyboard Example in touchgfx UI templates. Example works the same as I described. For better understanding I'm atthacing video.
I have already managed to solve these problems by editing the Keyboard.cpp file, but I still report this to clarify whether this is an bug or my misunderstanding of using Keyboard.
Solved! Go to Solution.
2020-11-18 02:32 AM
Hi again,
Thanks for your feedback and I was probably a bit quick to write the bug off as a bad use of the simulator. Sorry about that. I was able to reproduce it, and I have made a fix which should make it into the next release of TouchGFX.
The bug is in Keyboard.cpp in
if (key.keyId != 0)
{
located at line 201. Both lines should be moved to JUST ABOVE line 220:
if (buffer)
{
so the code looks like:
...
Keyboard::Key key = getKeyForCoordinates(x, y);
if (type == ClickEvent::PRESSED)
{
<same code>;
}
if (type == ClickEvent::RELEASED)
{
if (cancelIsEmitted)
{
cancelIsEmitted = false;
}
else
{
if (key.keyId != 0)
{
if (buffer)
{
Unicode::UnicodeChar c = getCharForKey(key.keyId);
...
I hope this helps.
2020-05-22 05:27 AM
Hello,
Thank you very much for your remark, we will try to fix this issue as soon as possible.
/Alexandre
2020-11-17 02:22 AM
Hi,
I looked into this, and it is not an actual bug in TouchGFX. I noticed that you move the mouse completely outside the simulator window, so TouchGFX never gets the button release event. The second time you click on the key (or actually anywhere inside the simulator window) the mouse down is discarded and the mouse up is handled. Since you already dragged away from the "J", the event is cancelled. In other words, the second press is just the completion of the first drag (outside the simulator).
If you click the "J" and drag to another key (still inside the simulator window) everything works as expected.
I hope this clarifies the issue. If not, please let us know.
Regards,
Søren
2020-11-17 03:10 AM
Hi @Soren Pingel DALSGAARD ,
I watched the video again and I can't see that I moved the mouse completely outside the simulator window ( I moved it outside the keyboard area). So I tried again and record another video so you can clearly see what I mean:
First case:
Second case:
I suggest you try it yourself and if possible try it on a hardware not simulator . I noticed this problem on real hardware with a touch display . I still think that this is a bug as I can't see the right purpose of this.
2020-11-18 02:32 AM
Hi again,
Thanks for your feedback and I was probably a bit quick to write the bug off as a bad use of the simulator. Sorry about that. I was able to reproduce it, and I have made a fix which should make it into the next release of TouchGFX.
The bug is in Keyboard.cpp in
if (key.keyId != 0)
{
located at line 201. Both lines should be moved to JUST ABOVE line 220:
if (buffer)
{
so the code looks like:
...
Keyboard::Key key = getKeyForCoordinates(x, y);
if (type == ClickEvent::PRESSED)
{
<same code>;
}
if (type == ClickEvent::RELEASED)
{
if (cancelIsEmitted)
{
cancelIsEmitted = false;
}
else
{
if (key.keyId != 0)
{
if (buffer)
{
Unicode::UnicodeChar c = getCharForKey(key.keyId);
...
I hope this helps.
2020-11-19 01:37 AM
Hi @Soren Pingel DALSGAARD
Today I tried the fix and it works.
Thank you .