14 #include "Container.h" 34 constexpr
auto makeKeySpec(
const char *values) noexcept {
36 const char *cp = values;
39 v =
static_cast<uint32_t
>(*cp++);
47 template<
class I,
typename Arg,
typename ... Args>
48 constexpr I makeKeySpecInit(I first, I last, Arg arg, Args ... args) noexcept {
50 *first =
static_cast<uint32_t
>(arg);
52 if constexpr (
sizeof...(args) > 0) {
53 first = makeKeySpecInit(first, last, args...);
59 template<
size_t N,
typename ... Args>
60 constexpr
auto makeKeySpec(Args ... args) noexcept {
62 auto first = a.begin();
64 last = makeKeySpecInit(first, last, args...);
69 template<
size_t M,
size_t N>
73 using KSS = std::array<char,5>;
76 template<
size_t R,
size_t M,
size_t N>
91 build(shared_ptr <Keyboard> keyboard,
Size keySize,
int fontSize,
const std::string &fontName) = 0;
100 std::shared_ptr<KeyboardPlugin> mKeyboardPlugin{};
108 std::string mFontName{};
129 explicit Keyboard(std::shared_ptr<KeyboardPlugin> keyboardPlugin) : mKeyboardPlugin(
std::move(keyboardPlugin)) {}
138 void initializeComposite()
override;
147 static constexpr
size_t Rows = 4;
148 static constexpr
size_t KeysPerRow = 11;
149 static constexpr
size_t Depth = 4;
152 std::weak_ptr<Keyboard> mKeyboard{};
169 None, Symbols1, Symbols2,
172 uint32_t mTempShiftKey{0};
173 bool mCapsLock{
false};
178 std::shared_ptr<Slot<Button::SignalType>> rxKey{};
179 std::shared_ptr<Slot<Button::SignalType>> rxCtl{};
180 std::shared_ptr<Slot<Button::SignalType>> rxToggle{};
194 void setKeyboardMode();
199 void changeKeyboardFace();
203 ~
QUERTY()
override =
default;
210 void build(shared_ptr <Keyboard> keyboard,
Size keySize,
int fontSize,
const std::string &fontName)
override;
219 static constexpr
size_t Rows = 5;
220 static constexpr
size_t KeysPerRow = 3;
223 static constexpr
size_t SideCols = 1;
224 static constexpr
size_t SideKeysPerCol = 5;
227 std::shared_ptr<Slot<Button::SignalType>> rxKey{};
238 void build(std::shared_ptr<Keyboard> keyboard,
Size keySize,
int fontSize,
const std::string &fontName)
override;
std::array< std::array< KeySpec< N >, M >, R > KeyboardSpec
Type for a full Keyboard specification.
Definition: Keyboard.h:77
SymbolState
The state of symbol selection.
Definition: Keyboard.h:168
std::array< KeySpec< N >, M > KeySpecRow
A row of KeySpec specifications.
Definition: Keyboard.h:70
KeyboardMode
Keyboard modes (cases)
Definition: Keyboard.h:22
A touch keyboard.
Definition: Keyboard.h:33
static const KeyboardSpec< Rows, KeysPerRow, 1 > NumberData
The main number pad KeyboardSpec.
Definition: Keyboard.h:221
KeyboardMode
Set the state of the keyboard.
Definition: Keyboard.h:160
Encapsulate the KeyboardSpec specification and build function.
Definition: Keyboard.h:85
Numbers and more symbols.
static const KeyboardSpec< SideCols, SideKeysPerCol, 1 > SideNumberData
The side key data.
Definition: Keyboard.h:225
std::array< char, 5 > KSS
Type to help construct a KeySpec from a string.
Definition: Keyboard.h:73
A composite of a Position and a Size.
Definition: Types.h:307
A KeyboardPlugin for a QWERTY keyboard.
Definition: Keyboard.h:145
Written as a workaround for an issue in the SDL2 Library.
Definition: Renderer.h:64
A size in integer dimensions.
Definition: Types.h:230
ToDo: There is an issue that the initial scroll interaction is lost if the click/press lands on a Wid...
Definition: CelestialOverlay.cpp:13
static const KeyboardSpec< Rows, KeysPerRow, Depth > QWERTYData
The KeyboardSpec.
Definition: Keyboard.h:150
Definition: Keyboard.h:17
A numeric keypad KeyboardPlugin.
Definition: Keyboard.h:217
Keyboard(std::shared_ptr< KeyboardPlugin > keyboardPlugin)
Constructor.
Definition: Keyboard.h:129