Skip to main content
aarba.1
Associate
November 22, 2021
Question

how can i change position of entered text of keyboard (The area where text is written ) and color of it ?

  • November 22, 2021
  • 2 replies
  • 855 views

..

This topic has been closed for replies.

2 replies

mƎALLEm
Technical Moderator
November 22, 2021

Hello,

If you're talking about a position and color that will never change, it's done by TouchGFX designer itself.

If you're talking about a dynamic change, in your <screen>View.cpp

Normally you call:

<yourtext>.setPosition(<X position>, <Y position>, <width>, <heigth>);

<yourtext>.setColor(touchgfx::Color::getColorFromRGB(<R value>, <G value>, <B value>)); or <yourtext>.setColor(touchgfx::Color::getColorFrom24BitRGB(<R value>, <G value>, <B value>));

<yourtext>.invalidate();

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
aarba.1
aarba.1Author
Associate
November 23, 2021

thanks for replay , but i talk about standard keyboard custom container , i found it i can change it in ( keyboardLayout.hpp ) file .

in this structure :

static const Keyboard::Layout layout =

{

   BITMAP_KEYBOARD_BACKGROUND_ID,

   keyArray,

   30,

   callbackAreas,

   3,

   Rect(10, 10,781, 312),  ////baraye toghiyire makane khoruji

   TypedText(T_ENTEREDTEXT),

#if !defined(USE_BPP) || USE_BPP==16

   0x215249,   ///// baraye taghire range khoroji

#elif USE_BPP==24

   0xFFFFFF,

#elif USE_BPP==8

   0xFF,

#elif USE_BPP==4

   0xF,

#elif USE_BPP==2

   0x3,

#else

#error Unknown USE_BPP

#endif

   Typography::KEYBOARD,

   0

};