Files
sloposk/src/layout/KeymapKeys.h
T
ericek111andClaude Opus 5.5 23e957660f Reword code comments in plain technical language
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>
2026-11-03 19:58:59 +01:00

39 lines
1.3 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#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);