Pervasive Displays Library Suite - Reference Manual 9.0.3
Library for Pervasive Displays e-paper screens, extension boards and development kits
Loading...
Searching...
No Matches
Keyboard Class Reference

Keyboard GUI element. More...

#include <hV_GUI.h>

Inheritance diagram for Keyboard:
Collaboration diagram for Keyboard:

Public Member Functions

 Keyboard (GUI *gui)
 Constructor.
 
void dDefine (uint16_t x0, uint16_t y0, uint16_t dx, uint16_t dy, Item *keys, uint8_t columns=4, uint8_t lines=3, uint8_t size0=0xff)
 Define the keyboard, vector coordinates.
 
void define (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, Item *keys, uint8_t columns=4, uint8_t lines=3, uint8_t size0=0xff)
 Define the keyboard, rectangle coordinates.
 
void setOption (bool option=true)
 Draw frames around keys.
 
void drawInitial ()
 Draw the initial keyboard.
 
void draw (uint8_t indexColumn, uint8_t indexLine, fsmGUI_e fsm=fsmReleased)
 Update the keyboard.
 
void setState (bool state=true)
 Define state of the area.
 
bool check (uint8_t mode=0)
 Check if area is pressed.
 
uint16_t getIndex ()
 Return index of the touched key.
 
- Public Member Functions inherited from Area
 Area (GUI *gui)
 Constructor.
 
void dDefine (uint16_t x0, uint16_t y0, uint16_t dx, uint16_t dy, uint16_t index=0x0000)
 Define area, vector coordinates.
 
bool getState ()
 Return state of the area.
 
void setState (bool state=true)
 Define state of the area.
 
void setOption (bool option=true)
 Set option of the area.
 
void setStyle (uint8_t style=0)
 Define the default style.
 
bool check (uint8_t mode=0)
 Check if area is pressed.
 
uint16_t getIndex ()
 Return index.
 

Detailed Description

Keyboard GUI element.

Keyboard displays columns and rows of keys.

Constructor & Destructor Documentation

◆ Keyboard()

Keyboard::Keyboard ( GUI * gui)

Constructor.

Parameters
gui&gui to which the element belongs

Member Function Documentation

◆ check()

bool Keyboard::check ( uint8_t mode = 0)

Check if area is pressed.

Parameters
modedefault = checkNormal = area waits for release, checkInstant = element is activated by press only
Returns
true if button pressed

◆ dDefine()

void Keyboard::dDefine ( uint16_t x0,
uint16_t y0,
uint16_t dx,
uint16_t dy,
Item * keys,
uint8_t columns = 4,
uint8_t lines = 3,
uint8_t size0 = 0xff )

Define the keyboard, vector coordinates.

Parameters
x0point coordinate, x-axis
y0point coordinate, y-axis
dxlength, x-axis
dyheight, y-axis
keysarray of items for keys, one item per key
columnsnumber of columns, default = 4
linesnumber of rows, default = 3
size0size for text, default = fontSizeAutomatic = automatic
Note
Keys are arranged per line.
Line 1: Column 1, Column 2, ... Column<columns>
Line 2: Column 1, Column 2, ... Column<columns>
...
Line <lines>: Column 1, Column 2, ... Column<columns>


More: Coordinates, Colours

◆ define()

void Keyboard::define ( uint16_t x1,
uint16_t y1,
uint16_t x2,
uint16_t y2,
Item * keys,
uint8_t columns = 4,
uint8_t lines = 3,
uint8_t size0 = 0xff )

Define the keyboard, rectangle coordinates.

Parameters
x1top left coordinate, x-axis
y1top left coordinate, y-axis
x2bottom right coordinate, x-axis
y2bottom right coordinate, y-axis
keysarray of items for keys
columnsnumber of columns, default = 4
linesnumber of rows, default = 3
size0size for text, default = fontSizeAutomatic = automatic


More: Coordinates, Colours

◆ draw()

void Keyboard::draw ( uint8_t indexColumn,
uint8_t indexLine,
fsmGUI_e fsm = fsmReleased )

Update the keyboard.

Parameters
indexColumncell to update, column number = 0..columns - 1
indexLinecell to update, row number = 0..lines - 1
fsmstate
Note
4 states
* if button enabled,
fsm = fsmReleased, fsmTouched, fsmConfirmed
* if button disabled,
flag = true: statement checkbox, flag = false: unavailable checkbox

◆ getIndex()

uint16_t Keyboard::getIndex ( )

Return index of the touched key.

Returns
index from items defined with dDefine, 0 = none

◆ setOption()

void Keyboard::setOption ( bool option = true)

Draw frames around keys.

The keyboard is initialised with false = no boxes. Use setOption to draw frames.

Parameters
optiondefault = optionWithFrame = within boxes, false = no frames

◆ setState()

void Keyboard::setState ( bool state = true)

Define state of the area.

Parameters
statedefault = stateEnabled = area enabled, stateDisabled = otherwise
Note
When created, state set to false

The documentation for this class was generated from the following file: