Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
Functions
nbgl_layout_keyboard_nanos.c File Reference

Implementation of predefined layouts management for Nano target, for Keyboard. More...

#include <string.h>
#include <stdlib.h>
#include "nbgl_debug.h"
#include "nbgl_layout_internal_nanos.h"
#include "glyphs.h"
#include "os_pic.h"
#include "os_helpers.h"
#include "lcx_rng.h"
Include dependency graph for nbgl_layout_keyboard_nanos.c:

Go to the source code of this file.

Functions

int nbgl_layoutAddKeyboard (nbgl_layout_t *layout, const nbgl_layoutKbd_t *kbdInfo)
 Creates a keyboard on bottom of the screen, with the given configuration.
 
int nbgl_layoutUpdateKeyboard (nbgl_layout_t *layout, uint8_t index, uint32_t keyMask)
 Updates an existing keyboard on bottom of the screen, with the given configuration.
 
int nbgl_layoutAddEnteredTextAdvanced (nbgl_layout_t *layout, const char *text, bool lettersOnly, bool obfuscated)
 Adds a "text entry" area under the previously entered object. The max number of really displayable characters is 8, even if there are 9 placeholders (_) If longer than 8 chars, the first ones are replaced by a '..' The 9th placeholder is never filled.
 
int nbgl_layoutAddEnteredText (nbgl_layout_t *layout, const char *text, bool lettersOnly)
 Adds a "text entry" area under the previously entered object. The max number of really displayable characters is 8, even if there are 9 placeholders (_) If longer than 8 chars, the first ones are replaced by a '..' The 9th placeholder is never filled.
 
int nbgl_layoutUpdateEnteredText (nbgl_layout_t *layout, uint8_t index, const char *text)
 Updates an existing "text entry" area, created with nbgl_layoutAddEnteredText()
 

Detailed Description

Implementation of predefined layouts management for Nano target, for Keyboard.

Implementation of predefined layouts management for Nano target, for Keypad.

Definition in file nbgl_layout_keyboard_nanos.c.

Function Documentation

◆ nbgl_layoutAddEnteredText()

int nbgl_layoutAddEnteredText ( nbgl_layout_t layout,
const char *  text,
bool  lettersOnly 
)

Adds a "text entry" area under the previously entered object. The max number of really displayable characters is 8, even if there are 9 placeholders (_) If longer than 8 chars, the first ones are replaced by a '..' The 9th placeholder is never filled.

Parameters
layoutthe current layout
textstring to display in the area
lettersOnlyif true, display 8 chars placeholders, otherwise 9
Returns
>= 0 if OK

Definition at line 197 of file nbgl_layout_keyboard_nanos.c.

◆ nbgl_layoutAddEnteredTextAdvanced()

int nbgl_layoutAddEnteredTextAdvanced ( nbgl_layout_t layout,
const char *  text,
bool  lettersOnly,
bool  obfuscated 
)

Adds a "text entry" area under the previously entered object. The max number of really displayable characters is 8, even if there are 9 placeholders (_) If longer than 8 chars, the first ones are replaced by a '..' The 9th placeholder is never filled.

Parameters
layoutthe current layout
textstring to display in the area
lettersOnlyif true, display 8 chars placeholders, otherwise 9
obfuscatedif true, entered text is obfuscated
Returns
>= 0 if OK

Definition at line 151 of file nbgl_layout_keyboard_nanos.c.

◆ nbgl_layoutAddKeyboard()

int nbgl_layoutAddKeyboard ( nbgl_layout_t layout,
const nbgl_layoutKbd_t kbdInfo 
)

Creates a keyboard on bottom of the screen, with the given configuration.

Parameters
layoutthe current layout
kbdInfoconfiguration of the keyboard to draw (including the callback when touched)
Returns
the index of keyboard, to use in nbgl_layoutUpdateKeyboard()

Definition at line 51 of file nbgl_layout_keyboard_nanos.c.

◆ nbgl_layoutUpdateEnteredText()

int nbgl_layoutUpdateEnteredText ( nbgl_layout_t layout,
uint8_t  index,
const char *  text 
)

Updates an existing "text entry" area, created with nbgl_layoutAddEnteredText()

Parameters
layoutthe current layout
indexindex of the text (return value of nbgl_layoutAddEnteredText())
textstring to display in the area
Returns
<0 if error, 0 if OK with text fitting the area, 1 of 0K with text not fitting the area

Definition at line 211 of file nbgl_layout_keyboard_nanos.c.

◆ nbgl_layoutUpdateKeyboard()

int nbgl_layoutUpdateKeyboard ( nbgl_layout_t layout,
uint8_t  index,
uint32_t  keyMask 
)

Updates an existing keyboard on bottom of the screen, with the given configuration.

Parameters
layoutthe current layout
indexindex returned by nbgl_layoutAddKeyboard()
keyMaskmask of keys to activate/deactivate on keyboard
Returns
>=0 if OK

Definition at line 98 of file nbgl_layout_keyboard_nanos.c.