2020-04-21 06:46 AM
Hey there,
I have a strange problem with my custom keyboard.
In the simulator everything looks and works fine. See image:
But when I download it to my target, following screen is presented:
The touch events and the active rectangle are correct and the correct values are shown in the text area. See following image:
When touching e.g number 2, the overlapping numbers disappear. See:
There seems to be a problem with displaying the numbers, the overall functionality seems to work.
Any ideas what's happening here?
Thanks a lot.
/jimmii
2020-04-21 01:05 PM
How are you defining these "Buttons" ?
2020-04-21 09:47 PM
HI @Martin KJELDSEN
The Layout is defined as follows:
static const Keyboard::Layout layout =
{
BITMAP_NUMERICKEYBOARD_ID,
keyArray,
10,
callbackAreas,
2,
Rect(0, 0, 272-7, 88),
TypedText(GetText(T_KEYBOARD_NUMERIC_TEXT_ENTERED, Typography::F_30_PT)),
0xFFFF,
Typography::F_30_PT,
0xFFFF
};
And the Keys:
static const Keyboard::Key keyArray[10] =
{
{ 1, Rect(0 + 88 * 0, 88 * 1, 82, 62), BITMAP_NUMERICKEYBOARDBUTTON_ID},
{ 2, Rect(0 + 88 * 1, 88 * 1, 82, 62), BITMAP_NUMERICKEYBOARDBUTTON_ID},
{ 3, Rect(0 + 88 * 2, 88 * 1, 82, 62), BITMAP_NUMERICKEYBOARDBUTTON_ID},
{ 4, Rect(0 + 88 * 0, 153 * 1, 82, 62), BITMAP_NUMERICKEYBOARDBUTTON_ID},
{ 5, Rect(0 + 88 * 1, 153 * 1, 82, 62), BITMAP_NUMERICKEYBOARDBUTTON_ID},
{ 6, Rect(0 + 88 * 2, 153 * 1, 82, 62), BITMAP_NUMERICKEYBOARDBUTTON_ID},
{ 7, Rect(0 + 88 * 0, 218 * 1, 82, 62), BITMAP_NUMERICKEYBOARDBUTTON_ID},
{ 8, Rect(0 + 88 * 1, 218 * 1, 82, 62), BITMAP_NUMERICKEYBOARDBUTTON_ID},
{ 9, Rect(0 + 88 * 2, 218 * 1, 82, 62), BITMAP_NUMERICKEYBOARDBUTTON_ID},
{10, Rect(0 + 88 * 1, 283 * 1, 82, 62), BITMAP_NUMERICKEYBOARDBUTTON_ID}
};
And the KeyMapping:
static const Keyboard::KeyMapping KeyMappingsNum[10] =
{
{ 1, 49}, // 1
{ 2, 50}, // 2
{ 3, 51}, // 3
{ 4, 52}, // 4
{ 5, 53}, // 5
{ 6, 54}, // 6
{ 7, 55}, // 7
{ 8, 56}, // 8
{ 9, 57}, // 9
{10, 48} // 0
};
Hope this helps.
/jimmii
2020-04-22 12:18 AM
The texts are suspiciously offset by what is probably 88 pixels for each row. I think maybe it would be easier if you sent the project. Just for fun, could you try putting in absolute coordinates rather than calculating them?
/Martin
2020-04-22 12:35 AM
It's not that easy - it's a confidential project.
I'll try to strip it down to the minimum.
But why is the keyboard displayed correctly in the simulator?
2020-04-22 02:38 AM
I don't know off the top of my head, that's why i wanted a project to play with. Maybe you could strip it down?
Did you try playing with absolute coordinates?
/Martin
2020-04-22 03:58 AM
Hey @Martin KJELDSEN
OK, I will try to strip it down.
In the meantime I did some tests. I only displayed one digit to keep it simple.
With this code (Button coordinates 0/0)
static const Keyboard::Key keyArray[1] =
{
{ 1, Rect(0, 0, 82, 62), BITMAP_NUMERICKEYBOARDBUTTON_ID}
}
I get this (which is correct, the label is "underneath" the active button):
With coordinates (88/0):
static const Keyboard::Key keyArray[1] =
{
{ 1, Rect(88, 0, 82, 62), BITMAP_NUMERICKEYBOARDBUTTON_ID}
}
I get: (Button moved correctly in x-position but the label is at the wrong position)
With coordinates (0/88):
static const Keyboard::Key keyArray[1] =
{
{ 1, Rect(0, 88, 82, 62), BITMAP_NUMERICKEYBOARDBUTTON_ID}
}
Again, the button moved correctly in y-position, the label also moved but at the wrong position.
With coordinates (88/88):
static const Keyboard::Key keyArray[1] =
{
{ 1, Rect(88, 88, 82, 62), BITMAP_NUMERICKEYBOARDBUTTON_ID}
}
The button and the label are at the correct position (label underneath the active button)
It seems as the label corrdinates are not translated correctly. I'm using the display in portrait mode. Is there a difference as how the simulator translates the coordinates in comparison to the "target" code?
Maybe you can reproduce this with the sample keyboard code (I also took that code and adapted it to my requirements)
In the meantime I will provide the code for you.
Thanks a lot.
/jimmii
2020-04-22 05:10 AM
2020-04-27 06:55 AM
Hi @Martin KJELDSEN
Any suggestions?
Could it be related to the use of the ARMCLANG library?
Regards, /jimmii
2020-04-27 06:30 PM
Hi jimmii,
Thanks for the update. It shouldn't have anything to do with ARMCLANG specifically. It may have something to do with the orientation,but i also kind of doubt that. I'll try to check out your project and maybe replicate this on my own end.
Thanks!
/Martin