Fix double-space period, shift double-tap; settings; letters from system keymap
- Double-space replaced the space via a Backspace keysym, which clients apply after the commit: use delete_surrounding_text with the commit - Tests use a shared FakeEngine that applies ops to a simulated field - Double-tap shift locks at a sentence start; typing between taps doesn't - Organization name set: config lives in ~/.config/sloposk/ - Settings (auto-capitalization, double-space period) with a ⚙ panel - Letter rows come from the compositor's XKB keymap; other letters of the layout become long-press alternates; globe switches the system layout over org.kde.keyboard - One JSON template for non-letter layers; stretch keys even out rows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+11
-4
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <QHash>
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
@@ -14,6 +15,7 @@ enum class KeyType {
|
||||
Globe,
|
||||
Dismiss,
|
||||
Spacer, // empty room, e.g. the half-key indent of the home row
|
||||
Letters, // template only: a row of letters from the system keymap
|
||||
};
|
||||
|
||||
struct KeyDef {
|
||||
@@ -24,6 +26,11 @@ struct KeyDef {
|
||||
QStringList alternates; // long-press choices
|
||||
QString target; // layer to switch to (LayerSwitch only)
|
||||
qreal width = 1.0; // in key units
|
||||
bool stretch = false; // grows so the row is as wide as the layer's widest
|
||||
|
||||
// Letters placeholders only.
|
||||
int lettersRow = -1; // which keymap row (0 = top)
|
||||
QStringList flicks; // flick symbol per letter, left to right
|
||||
|
||||
// Text this key shows/types; only character keys change case.
|
||||
QString text(bool uppercase) const
|
||||
@@ -42,11 +49,11 @@ struct Layer {
|
||||
};
|
||||
|
||||
struct Layout {
|
||||
QString id; // e.g. "en-US"
|
||||
QString name; // human readable
|
||||
QString locale; // e.g. "en_US"
|
||||
QString base; // id of a layout to take missing layers from
|
||||
QString id;
|
||||
QString name; // human readable, e.g. "Slovak"
|
||||
QList<Layer> layers; // the first one is shown by default
|
||||
// Template only: long-press choices for keymap letters, by lowercase letter.
|
||||
QHash<QString, QStringList> alternates;
|
||||
|
||||
const Layer *layer(const QString &layerName) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user