2022-10-03 03:04 AM
Im doing numbers keyboard and do not know how to change bitmap position then i press the buttonIm using this struct :
2022-10-03 07:04 AM
Hello heyo,
Not sure what you're trying to do here. Why do use this struct ?
By the way, we recently shared here a number keypad widget that you can import and use (or get inspiration from). If it doesn't help you, please elaborate your issue.
/Osman
2022-10-03 08:10 AM
Hello @Osman SOYKURT ,
I'm using example which is in touchgfx examples . This struct is used to declare unicode char id, area occupied by key and bitmap shows then button is pressed. So I want to change highlighted bitmap position but there is no opportunity to do that. How I can do that?
2022-10-04 02:23 AM
Hello heyo,
Ok, so I guess you have a keyArray or something like that right ? When you'll instantiate your keys, you can specify the x and y value of the keyArea rect. I don't know which example you're using but I invite you to have a look on the Keyboard example that we provide. Check the KeyboardLayout.hpp file especially, it will be a big help I think.
/**
* Array specifying the keys used in the CustomKeyboard.
*/
static const Keyboard::Key keyArray[30] =
{
{ 1, Rect(7, 61, 26, 40), BITMAP_KEYBOARD_KEY_HIGHLIGHTED_ID},
{ 2, Rect(7 + 28, 61, 26, 40), BITMAP_KEYBOARD_KEY_HIGHLIGHTED_ID},
{ 3, Rect(7 + 28 * 2, 61, 26, 40), BITMAP_KEYBOARD_KEY_HIGHLIGHTED_ID},
....
....
}
/Osman
2022-10-04 02:35 AM
Yes, its looks like that. When i change keyarea rect, changes pressed area position, not a highlighted bitmap position. I need to change bitmap position because now it looks like that:If i can edit keyarea rect and highlighted bitmap rect it would be nice.
2022-10-04 04:16 AM
Ok then maybe you'll need to have another keyboard then because the Layout struct doesn't differentiate the coordinate of your key unpressed and pressed.
struct Layout
{
BitmapId bitmap; ///< The bitmap used for the keyboard layout
const Key* keyArray; ///< The keys on the keyboard layout
uint8_t numberOfKeys; ///< The number of keys on this keyboard layout
CallbackArea* callbackAreaArray; ///< The array of areas and corresponding callbacks
uint8_t numberOfCallbackAreas; ///< The number of areas and corresponding callbacks
Rect textAreaPosition; ///< The area where text is written
TypedText textAreaFont; ///< The font used for typing text
colortype textAreaFontColor; ///< The color used for the typing text
FontId keyFont; ///< The font used for the keys
colortype keyFontColor; ///< The color used for the keys
};
/Osman
2022-10-04 04:38 AM
@Osman SOYKURT :sad_but_relieved_face: