Embedded SDK
Embedded SDK
|
The construction and touch management of a keyboard object. More...
#include "nbgl_debug.h"
#include "nbgl_front.h"
#include "nbgl_draw.h"
#include "nbgl_obj.h"
#include "nbgl_fonts.h"
#include "nbgl_touch.h"
#include "glyphs.h"
#include "os_io.h"
Go to the source code of this file.
Macros | |
#define | FIRST_LINE_CHAR_COUNT 10 |
#define | SECOND_LINE_CHAR_COUNT 9 |
#define | NORMAL_KEY_WIDTH 48 |
#define | LETTER_OFFSET_Y (((KEYBOARD_KEY_HEIGHT - 36) / 2) & 0xFFC) |
#define | SHIFT_KEY_WIDTH (NORMAL_KEY_WIDTH + SECOND_LINE_OFFSET) |
#define | SECOND_LINE_OFFSET ((SCREEN_WIDTH - (SECOND_LINE_CHAR_COUNT * NORMAL_KEY_WIDTH)) / 2) |
#define | SPACE_KEY_WIDTH 336 |
#define | SWITCH_KEY_WIDTH (SCREEN_WIDTH - SPACE_KEY_WIDTH) |
#define | SPECIAL_CHARS_KEY_WIDTH (NORMAL_KEY_WIDTH * 2 + SECOND_LINE_OFFSET) |
#define | BACKSPACE_KEY_WIDTH_FULL SHIFT_KEY_WIDTH |
#define | BACKSPACE_KEY_WIDTH_DIGITS SPECIAL_CHARS_KEY_WIDTH |
#define | BACKSPACE_KEY_WIDTH_LETTERS_ONLY (SCREEN_WIDTH - 7 * NORMAL_KEY_WIDTH) |
#define | IS_KEY_MASKED(_index) (keyboard->keyMask & (1 << _index)) |
Functions | |
void | nbgl_keyboardTouchCallback (nbgl_obj_t *obj, nbgl_touchType_t eventType) |
function to be called when the keyboard object is touched More... | |
bool | nbgl_keyboardGetPosition (nbgl_keyboard_t *kbd, char index, uint16_t *x, uint16_t *y) |
This function gets the position (top-left corner) of the key at the given index. (to be used for Testing purpose) More... | |
void | nbgl_objDrawKeyboard (nbgl_keyboard_t *kbd) |
This function draws a keyboard object. More... | |
Variables | |
const char | kbd_digits [] = "1234567890-/:;()&@\".,?!\'" |
The construction and touch management of a keyboard object.
Definition in file nbgl_obj_keyboard.c.
#define BACKSPACE_KEY_WIDTH_DIGITS SPECIAL_CHARS_KEY_WIDTH |
Definition at line 47 of file nbgl_obj_keyboard.c.
#define BACKSPACE_KEY_WIDTH_FULL SHIFT_KEY_WIDTH |
Definition at line 46 of file nbgl_obj_keyboard.c.
#define BACKSPACE_KEY_WIDTH_LETTERS_ONLY (SCREEN_WIDTH - 7 * NORMAL_KEY_WIDTH) |
Definition at line 48 of file nbgl_obj_keyboard.c.
#define FIRST_LINE_CHAR_COUNT 10 |
Definition at line 27 of file nbgl_obj_keyboard.c.
#define IS_KEY_MASKED | ( | _index | ) | (keyboard->keyMask & (1 << _index)) |
Definition at line 50 of file nbgl_obj_keyboard.c.
#define LETTER_OFFSET_Y (((KEYBOARD_KEY_HEIGHT - 36) / 2) & 0xFFC) |
Definition at line 35 of file nbgl_obj_keyboard.c.
#define NORMAL_KEY_WIDTH 48 |
Definition at line 34 of file nbgl_obj_keyboard.c.
#define SECOND_LINE_CHAR_COUNT 9 |
Definition at line 28 of file nbgl_obj_keyboard.c.
#define SECOND_LINE_OFFSET ((SCREEN_WIDTH - (SECOND_LINE_CHAR_COUNT * NORMAL_KEY_WIDTH)) / 2) |
Definition at line 38 of file nbgl_obj_keyboard.c.
#define SHIFT_KEY_WIDTH (NORMAL_KEY_WIDTH + SECOND_LINE_OFFSET) |
Definition at line 37 of file nbgl_obj_keyboard.c.
#define SPACE_KEY_WIDTH 336 |
Definition at line 42 of file nbgl_obj_keyboard.c.
#define SPECIAL_CHARS_KEY_WIDTH (NORMAL_KEY_WIDTH * 2 + SECOND_LINE_OFFSET) |
Definition at line 45 of file nbgl_obj_keyboard.c.
#define SWITCH_KEY_WIDTH (SCREEN_WIDTH - SPACE_KEY_WIDTH) |
Definition at line 44 of file nbgl_obj_keyboard.c.
bool nbgl_keyboardGetPosition | ( | nbgl_keyboard_t * | kbd, |
char | index, | ||
uint16_t * | x, | ||
uint16_t * | y | ||
) |
This function gets the position (top-left corner) of the key at the given index. (to be used for Testing purpose)
kbd | the object to be drawned |
index | ascii character (in lower-case) |
x | [out] the top-left position |
y | [out] the top-left position |
Definition at line 644 of file nbgl_obj_keyboard.c.
void nbgl_keyboardTouchCallback | ( | nbgl_obj_t * | obj, |
nbgl_touchType_t | eventType | ||
) |
function to be called when the keyboard object is touched
obj | touched object (keyboard) |
eventType | type of touch (only TOUCHED is accepted) |
Definition at line 526 of file nbgl_obj_keyboard.c.
void nbgl_objDrawKeyboard | ( | nbgl_keyboard_t * | kbd | ) |
This function draws a keyboard object.
kbd | the object to be drawned |
Definition at line 692 of file nbgl_obj_keyboard.c.
const char kbd_digits[] = "1234567890-/:;()&@\".,?!\'" |
Definition at line 65 of file nbgl_obj_keyboard.c.