cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove keychar from keyboard keys?

H_Drx
Associate II

Hi,

I,m looking for a way to remove or hide the keychar of the keyboard's keys or button, i'm using the custom keyboard from TouchGFX demo or examples, and i have a new asset that already have the keychar or key label. For this reason, i need to remove the keychar and prevent the keyboard class from drawing them.
How i can do that?

Best regards.

1 ACCEPTED SOLUTION

Accepted Solutions
H_Drx
Associate II

Hi,

I have found a work around, I don't like it, but it works, until i find the correct way to do this.
the work around is to use a typography that display nothing, make sure all wildcards are empty to avoid displaying anything and just in case use a very small size (1).
in your custom keyboard layout in

static const Keyboard::Layout layout =
{
    BITMAP_KEYBOARD_BACKGROUND_ID,
    keyboardArray,
    30,
    keyboardcallbackAreas,
    3,
    Rect(x, y, w, h),
    TypedText(T_ENTEREDTEXT),
    color_id,
    Typography::the_work_around_typography_name,
    any_color_for_keychar
};

Any other idea is welcome, if someone have a good solution or know the right solution, please share.

BR

View solution in original post

3 REPLIES 3
Imen.D
ST Employee

Hello @H_Drx,

I think this post can help you to hide the text : Solved: TouchGFX keyboard with password

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Hi, @Imen.D,

Thank you for your help, but i believe that post is talking about how to hide the text inside the text area, my question is how to remove the char on the button itself. for example the backspace button has no label or keychar, it's just image of a button with icon, and because that key has a callback, it will not be inserted in the key map, so it will have no keychar or label.
i believe in keyboard.cpp widged they have a draw function that will add a text area and display what every char is assigned and added in key map list.
maybe i will need to overwrite the draw function and prevent it from adding labels or char to keys.

BR

H_Drx
Associate II

Hi,

I have found a work around, I don't like it, but it works, until i find the correct way to do this.
the work around is to use a typography that display nothing, make sure all wildcards are empty to avoid displaying anything and just in case use a very small size (1).
in your custom keyboard layout in

static const Keyboard::Layout layout =
{
    BITMAP_KEYBOARD_BACKGROUND_ID,
    keyboardArray,
    30,
    keyboardcallbackAreas,
    3,
    Rect(x, y, w, h),
    TypedText(T_ENTEREDTEXT),
    color_id,
    Typography::the_work_around_typography_name,
    any_color_for_keychar
};

Any other idea is welcome, if someone have a good solution or know the right solution, please share.

BR