#pragma once #include #include struct xkb_keymap; // One typing key of a keymap layout, at its two shift levels. A level is // either text or a dead key (then `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; 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> rows; }; KeymapKeys readKeymapKeys(xkb_keymap *keymap, quint32 layoutIndex); // What a dead key shows and types when nothing composes: ´ for dead_acute. QString deadKeyText(quint32 keysym);