Text rules: auto-capitalization, double-space period, backspace repeat

- TextContext: field purpose/hints and text before the cursor, reported by
  the backend (KWin content_type + surrounding_text)
- TextRules: sentence-start and double-space heuristics, deletion helpers
- KeyRepeater: held backspace repeats, then deletes whole words (Ctrl+BS)
- Controller keeps a best-guess of the text before the cursor so rules work
  instantly and in fields that don't report surrounding text
- No auto-capitalization or smart punctuation in password/URL/email fields

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-14 14:59:21 +02:00
co-authored by Claude Opus 5.5
parent 2b5edeb365
commit 92c132c66f
22 changed files with 452 additions and 39 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
#pragma once
#include <QString>
#include <qnamespace.h>
// Turns what the keyboard produces into text operations.
// DirectEngine passes them straight through; prediction and swipe engines
@@ -11,5 +12,5 @@ public:
virtual ~InputEngine() = default;
virtual void commitText(const QString &text) = 0;
virtual void sendKeysym(quint32 keysym) = 0;
virtual void sendKeysym(quint32 keysym, Qt::KeyboardModifiers modifiers = Qt::NoModifier) = 0;
};