20#include <QVariantList>
68 Q_PROPERTY(
int page READ getPage WRITE setPage NOTIFY
pageChanged)
69 Q_PROPERTY(QStringList pageNames READ getPageNames CONSTANT)
70 Q_PROPERTY(QVariantList pageOrder READ getPageOrder CONSTANT)
71 Q_PROPERTY(
int pageCount READ getPageCount CONSTANT)
101 static constexpr int keyTotal = 47;
104 void setPage(
int val);
105 QStringList getPageNames()
const;
106 QVariantList getPageOrder()
const;
107 int getPageCount()
const;
110 Q_INVOKABLE
static QStringList keyLabels();
113 Q_INVOKABLE
static int pageFor(
bool shift,
bool ctrl,
bool alt);
121 Q_INVOKABLE
static int effectivePage(
bool shift,
bool ctrl,
bool alt,
bool caps);
124 Q_INVOKABLE QVariantMap
keyDataFor(
const QString& key,
125 bool shift,
bool ctrl,
bool alt,
bool caps)
const;
128 Q_INVOKABLE
static QString
pageBadge(
int page);
131 Q_INVOKABLE
static int indFor(
int page,
const QString& key);
141 Q_INVOKABLE
static QString
naturalChar(
const QString& key,
bool shift);
149 Q_INVOKABLE QVariantMap
keyData(
int page,
const QString& key)
const;
152 Q_INVOKABLE QVariantMap
spaceData()
const;
156 Q_INVOKABLE
static QString
chopLastToken(
const QString& str);
164 QVariantMap dataForInd(
int ind,
const QString& key,
int page)
const;
static QString pageDescription(int page)
The quiet line under the deck saying what this page is.
static int indFor(int page, const QString &key)
The font code on key of page, or 0 when that key is empty.
static QString chopLastToken(const QString &str)
Drop the last whole token off a code string – "RED<player>" -> "RED".
static int effectivePage(bool shift, bool ctrl, bool alt, bool caps)
Assignable keys per page: 26 letters + 10 digits + the 11 punctuation keys ( - = [ ] \ ; ' ,...
Render
< Current page = its modifier mask, 0-7.
@ RenderEmpty
No tile on this key.
@ RenderLabel
Control code: no glyph at all, so the cap shows its name.
@ RenderTile
A single 8x8 tile, clipped from the shared animated sheet.
@ RenderPreview
Multi-char/variable: render the expanded text (<poke> -> "Poke").
QVariantMap keyDataFor(const QString &key, bool shift, bool ctrl, bool alt, bool caps) const
keyData() for the page this key actually reads. What the deck binds to.
Category
Tile category. Order matches the old filter strip = the usage order.
protected::void pageChanged()
FontKeyboard(QObject *parent=nullptr)
static QString naturalChar(const QString &key, bool shift)
What a REAL keyboard (US layout) types for key with/without Shift – "a"/"A", "1"/"!...
static constexpr int pageTotal
Modifier combos: none/S/C/A/SC/SA/CA/SCA.
QVariantMap spaceData() const
The same map for the spacebar (the Space tile lives there, not on a letter).
static QString pageBadge(int page)
The modifier badge for a page, e.g. "" / "Shift" / "Ctrl+Alt".
QVariantMap keyData(int page, const QString &key) const
Everything a keycap needs: { ind, code, title, tip, category, render, empty, natural }...