2020-02-18 02:23 AM
Hi,
I have implemented a keyboard on TouchGFX and it works properly (the example keyboard).
My objective is to make that the typed text with the keyboard appears in the textArea that i have selected. I tried it using the Wildcard text but it doesn't worked for me.
Thanks,
Dani.
2020-02-18 03:02 AM
Hi Dani,
It's a bit unclear to me what you're trying to do. Can you rephrase?
/Martin
2020-02-18 03:15 AM
Hi Martin,
It's a common application, when we use the keyboard in our mobiles, we can see what we are writting in the corresponding text area; in this way i would like to do something like that.
I am using the code of the keyboard that provides the designer.
The following code is from CustomKeyboard.cpp:
#include <gui/common/CustomKeyboard.hpp>
CustomKeyboard::CustomKeyboard() : keyboard(),
modeBtnTextArea(),
capslockPressed(this, &CustomKeyboard::capslockPressedHandler),
backspacePressed(this, &CustomKeyboard::backspacePressedHandler),
modePressed(this, &CustomKeyboard::modePressedHandler),
keyPressed(this, &CustomKeyboard::keyPressedhandler),
alphaKeys(true),
uppercaseKeys(false),
firstCharacterEntry(false)
{
//Set the callbacks for the callback areas of the keyboard and set its layout.
layout.callbackAreaArray[0].callback = &capslockPressed;
layout.callbackAreaArray[1].callback = &backspacePressed;
layout.callbackAreaArray[2].callback = &modePressed;
keyboard.setLayout(&layout);
keyboard.setKeyListener(keyPressed);
keyboard.setPosition(0, 0, 320, 240);
keyboard.setTextIndentation();
//Allocate the buffer associated with keyboard.
memset(buffer, 0, sizeof(buffer));
keyboard.setBuffer(buffer, BUFFER_SIZE);
uppercaseKeys = true;
firstCharacterEntry = true;
modeBtnTextArea.setPosition(5, 196, 56, 40);
modeBtnTextArea.setColor(Color::getColorFrom24BitRGB(0xFF, 0xFF, 0xFF));
setKeyMappingList();
add(keyboard);
add(modeBtnTextArea);
}
....
I would like to know how are the typed letters saved in the keyboard buffer, in order to copy it's content and show it simultaneously through a textArea.
I tried this code in the MainView.cpp:
...
void MainView::setupScreen()
{
Unicode::snprintf(textArea1Buffer, TEXTAREA1_SIZE, "%d", buffer);
textArea1.invalidate();
}
....
Thanks,
Dani
2020-02-18 04:04 AM
Now i'm trying with:
...
void MainView::setupScreen()
{
memcpy(T_SINGLEUSEID1, T_ENTEREDTEXT, 18);
Unicode::snprintf(textArea1Buffer, TEXTAREA1_SIZE, "%d", T_SINGLEUSEID1);
textArea1.invalidate();
}
...
Where T_SINGLEUSEID1 is the content of the textArea1 and T_ENTEREDTEXT is the typed text with the keyboard (i think so at least).
It still doesn't work.
2020-02-18 04:35 AM
But doesn't the example do exactly this? It shows you what you're typing - in the textarea.
/Martin
2020-02-18 11:19 PM
Yes, but i would like to show it in a different textarea every time.
Dani