Something went wrong. Try again.
A fork of https://github.com/crosspoint-reader/crosspoint-reader
Something went wrong. Try again.
1.6 kB · 41 lines
C
123456789101112131415161718192021222324252627282930313233343536373839404142#pragma once
#include <FreeInkUI.h>#include <I18n.h>
#include <cstdint>
namespace keyboard_layouts {
struct LayoutInfo { freeink::ui::KeyboardLayoutId id; Language language;};
// Table position is the persisted bit assignment. Keep existing rows in place// and append new layouts so SDK enum changes cannot reinterpret saved masks.inline constexpr LayoutInfo ALL[] = { {freeink::ui::KeyboardLayoutId::QwertyEn, Language::EN}, {freeink::ui::KeyboardLayoutId::AzertyFr, Language::FR}, {freeink::ui::KeyboardLayoutId::QwertzDe, Language::DE}, {freeink::ui::KeyboardLayoutId::SpanishEs, Language::ES}, {freeink::ui::KeyboardLayoutId::CyrillicRu, Language::RU}, {freeink::ui::KeyboardLayoutId::CyrillicUk, Language::UK}, {freeink::ui::KeyboardLayoutId::CyrillicBe, Language::BE}, {freeink::ui::KeyboardLayoutId::CyrillicKk, Language::KK}, {freeink::ui::KeyboardLayoutId::HebrewIl, Language::HE}, {freeink::ui::KeyboardLayoutId::ArabicAr, Language::AR},};inline constexpr uint8_t COUNT = sizeof(ALL) / sizeof(ALL[0]);static_assert(COUNT <= 16, "keyboard layout mask is uint16_t");
inline constexpr uint16_t bitAt(const uint8_t i) { return static_cast<uint16_t>(1u << i); }// Symbol layers have no Latin letters, so credentials and URLs require at// least one of these layouts to remain enabled.inline constexpr uint16_t LATIN_BITS = bitAt(0) | bitAt(1) | bitAt(2) | bitAt(3);
uint16_t enabled();freeink::ui::KeyboardLayoutId startingLayout();freeink::ui::KeyboardLayoutId next(freeink::ui::KeyboardLayoutId current);
} // namespace keyboard_layouts