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:
@@ -1,11 +1,11 @@
|
||||
// End-to-end gesture tests: real Keyboard.qml, synthetic touch events.
|
||||
// Set SLOPOSK_SNAPSHOT_DIR to also save what the keyboard looks like mid-gesture.
|
||||
|
||||
#include "engine/InputEngine.h"
|
||||
#include "FakeEngine.h"
|
||||
#include "input/KeyboardController.h"
|
||||
#include "input/KeyboardSurface.h"
|
||||
#include "layout/LayoutModel.h"
|
||||
#include "layout/LayoutRepository.h"
|
||||
#include "TestLayouts.h"
|
||||
|
||||
#include <QQmlComponent>
|
||||
#include <QQmlEngine>
|
||||
@@ -21,21 +21,6 @@ using namespace Qt::StringLiterals;
|
||||
|
||||
namespace {
|
||||
|
||||
class FakeEngine : public InputEngine
|
||||
{
|
||||
public:
|
||||
void commitText(const QString &text) override { output += text; }
|
||||
void sendKeysym(quint32 keysym, Qt::KeyboardModifiers modifiers) override
|
||||
{
|
||||
keysyms.append(keysym);
|
||||
lastModifiers = modifiers;
|
||||
}
|
||||
|
||||
QString output;
|
||||
QList<quint32> keysyms;
|
||||
Qt::KeyboardModifiers lastModifiers;
|
||||
};
|
||||
|
||||
constexpr QPoint KeyboardOffset(0, 100); // room above for popups
|
||||
constexpr int LongPressWaitMs = 600;
|
||||
|
||||
@@ -47,7 +32,6 @@ class TestKeyboardSurface : public QObject
|
||||
|
||||
private:
|
||||
FakeEngine engine;
|
||||
LayoutRepository repo;
|
||||
LayoutModel model;
|
||||
std::unique_ptr<KeyboardController> controller;
|
||||
QQmlEngine qml;
|
||||
@@ -81,10 +65,8 @@ private:
|
||||
private Q_SLOTS:
|
||||
void initTestCase()
|
||||
{
|
||||
Q_INIT_RESOURCE(layouts);
|
||||
repo.loadDirectory(u":/layouts"_s);
|
||||
repo.finalize(u"en_US"_s);
|
||||
controller = std::make_unique<KeyboardController>(engine, model, repo);
|
||||
model.setLayout(TestLayouts::build("us"));
|
||||
controller = std::make_unique<KeyboardController>(engine, model);
|
||||
|
||||
QQmlComponent component(&qml, "Sloposk", "Keyboard");
|
||||
keyboard = qobject_cast<QQuickItem *>(component.createWithInitialProperties({
|
||||
|
||||
Reference in New Issue
Block a user