2019-09-11 12:34 AM
Hi
Is there a solution to open a keyboard when pressing on a textArea?
Now I have implemented a flexButton and a textArea above that button. By clicking on the text/button the keyboard is popping up. If you have lots of textAreas that's too much work.
Regards
Dejan
Solved! Go to Solution.
2019-09-11 05:09 AM
I am not sure I got your problem correctly. But try invalidating the entire view.
2019-09-11 03:18 AM
Would you please share more details to offer you help?
Are you clicking on a flexButton object or a TextArea object ? You can assign all objects to one eventHandler
2019-09-11 05:02 AM
I'm clicking on the flexButton object and it works fine.
I've tried the textArea with a ClickListener. I've used this https://touchgfx.zendesk.com/hc/en-us/articles/360002825452-Mixins-and-ClickListener as example.
There is a weird behavior, when I'm clicking on the textArea object. The ClickHandler is working fine, but it doesn't open the keyboard properly. I need to click anywhere on the screen and only then the keyboard is opening.
I call the same function with the flexButton and textArea Handler.
Here is a snippet of the code:
#include <gui/screen2_screen/Screen2View.hpp>
Screen2View::Screen2View() :
TextAreaClickedCallback(this, &Screen2View::TextArea2ClickHandler)
{
}
void Screen2View::setupScreen()
{
Screen2ViewBase::setupScreen();
textArea2.setClickAction(TextAreaClickedCallback);
}
void Screen2View::tearDownScreen()
{
Screen2ViewBase::tearDownScreen();
}
void Screen2View::showKeyboard()
{
keyboard.setPosition(0, 0, HAL::DISPLAY_WIDTH, HAL::DISPLAY_HEIGHT);
add(keyboard);
}
void Screen2View::onButtonCloseKeyboard()
{
remove(keyboard);
}
void Screen2View::onFlexButton1()
{
showKeyboard();
}
void Screen2View::onFlexButton2()
{
showKeyboard();
}
void Screen2View::TextArea2ClickHandler(const TextAreaWithOneWildcard& t, const ClickEvent& e)
{
if((&t == &textArea2))
{
showKeyboard();
}
}
2019-09-11 05:09 AM
I am not sure I got your problem correctly. But try invalidating the entire view.
2019-09-11 05:16 AM
Thank you very much. I had only to invalidate the keyboard.
Regards
Dejan
2019-09-11 05:18 AM
Glad I helped
2019-09-12 04:27 AM
Hi @Abdullah İhsanoğlu
I have another question. How did you manage to close the keyboard?
I would like to close by pressing on the enter button I added to CustomKeyboard.
I have no idea how I can get it working, because I need to close it from the screenView object.
Regards
Dejan