Comments only, no code changes. Replaces vague or personified phrasing with explicit statements of what the code does and why, uses bullet lists for multi-case behavior, and fixes the settings path in WindowSettings.h (~/.config/sloposk/sloposk.conf). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39 lines
1.3 KiB
C
39 lines
1.3 KiB
C
#pragma once
|
||
|
||
#include <QList>
|
||
#include <QString>
|
||
|
||
struct xkb_keymap;
|
||
|
||
// One typing key of a keymap layout, at its shift and AltGr levels. A level
|
||
// is either text or a dead key (then the text is its spacing accent, for labels).
|
||
struct KeymapKey {
|
||
enum class Position { Regular, Backslash, LessGreater }; // BKSL, LSGT: not on every keyboard
|
||
|
||
Position position = Position::Regular;
|
||
QString lower;
|
||
QString upper;
|
||
quint32 deadLower = 0; // dead keysym, 0 if the level types text
|
||
quint32 deadUpper = 0;
|
||
QString altGr; // third level (AltGr), empty if it types nothing
|
||
QString altGrUpper; // fourth level (AltGr+Shift)
|
||
quint32 deadAltGr = 0;
|
||
quint32 deadAltGrUpper = 0;
|
||
|
||
bool isLetter() const;
|
||
};
|
||
|
||
// The typing keys one layout of an XKB keymap has on a physical keyboard,
|
||
// in its four rows: 0 number row (TLDE, AE01–AE12), 1 top (AD01–AD12, BKSL),
|
||
// 2 home (AC01–AC11), 3 bottom (LSGT, AB01–AB10). Keys that type nothing on
|
||
// either level are left out.
|
||
struct KeymapKeys {
|
||
QString name; // e.g. "Slovak"
|
||
QList<QList<KeymapKey>> rows;
|
||
};
|
||
|
||
KeymapKeys readKeymapKeys(xkb_keymap *keymap, quint32 layoutIndex);
|
||
|
||
// Spacing accent for a dead keysym, used as its label and when nothing composes: ´ for dead_acute.
|
||
QString deadKeyText(quint32 keysym);
|