1.10 |
Key widget for the Keyboard widget. More...
#include <virtualkeyboard.h>
Public Member Functions | |
Key (const Image &img, int link, double length=1.0) noexcept | |
Key (const Image &img, KeyboardCode keycode, double length=1.0) noexcept | |
Key (const std::string &label, int link, double length=1.0) noexcept | |
Key (const std::string &label, KeyboardCode keycode, double length=1.0) noexcept | |
Key (uint32_t unicode, double length=1.0) noexcept | |
Key (uint32_t unicode, PanelKeys keys_multichoice, double length=1.0) noexcept | |
void | color (Palette::ColorId id, const Pattern &color, Palette::GroupId group=Palette::GroupId::normal) |
Set the key color. | |
void | font (const Font &font) |
Set the key font. | |
Protected Attributes | |
std::shared_ptr< Button > | m_button {nullptr} |
Button associated with the key. | |
KeyboardCode | m_keycode {EKEY_UNKNOWN} |
Code of the key. | |
PanelKeys | m_keys_multichoice |
Keys for the multichoice panel. | |
double | m_length |
Length multiplicator of the panel default key size. | |
int | m_link {-1} |
Id of the MainPanel to display when clicking on this button. | |
std::shared_ptr< Panel > | m_multichoice_panel {nullptr} |
Multichoice panel to display on long press event. | |
uint32_t | m_unicode {0} |
UTF32 code point for the key. | |
Friends | |
class | VirtualKeyboard |
Key widget for the Keyboard widget.
This widget allows to describe a key that will be used by the Keyboard widget. There are different kinds of keys:
Even if the VirtualKeyboard class automatically computes the base size of the keys, it's still possible to customize the size of a key by setting its length which is a factor for the base size width.
|
explicitnoexcept |
[in] | unicode | UTF32 code point for the key. It's also the label of the key. |
[in] | length | Length of the key. |
|
explicitnoexcept |
[in] | label | Label of the key. |
[in] | keycode | Code of the key. |
[in] | length | Length of the key. |
|
explicitnoexcept |
[in] | img | Image of the key. |
[in] | keycode | Code of the key. |
[in] | length | Length of the key. |
|
explicitnoexcept |
[in] | label | Label of the key. |
[in] | link | Id of the main panel to display when clicking on this key. The id depends on the order of registration of the main panels. It starts from 0. |
[in] | length | Length of the key. |
[in] | img | Image of the key. |
[in] | link | Id of the main panel to display when clicking on this key. The id depends on the order of registration of the main panels. It starts from 0. |
[in] | length | Length of the key. |
[in] | unicode | UTF32 code point for the key. |
[in] | keys_multichoice | Multichoice panel that has to be displayed after a long touch event. |
[in] | length | Length of the key. |
void color | ( | Palette::ColorId | id, |
const Pattern & | color, | ||
Palette::GroupId | group = Palette::GroupId::normal |
||
) |
Set the key color.
void font | ( | const Font & | font | ) |
Set the key font.
|
friend |
|
protected |
Code of the key.
|
protected |
Keys for the multichoice panel.
|
protected |
Length multiplicator of the panel default key size.
|
protected |
Id of the MainPanel to display when clicking on this button.
|
protected |
Multichoice panel to display on long press event.
|
protected |
UTF32 code point for the key.