15 Commits
Author SHA1 Message Date
Devin Lin d2a622c8b4 Introduce new input engine and framework to replace Qt VKBD 2026-10-14 20:00:54 -04:00
Kristen McWilliam f0e6d834b3 test: prevent flaky tests by draining stale events/responses 2026-07-10 11:04:58 -04:00
Kristen McWilliam 7453d0a655 fix(overlay): allow clients to receive actual key events
We were consuming key events and committing the text of the key
directly, which breaks clients that expect or require actual key events.

Instead, we still consume the key event (to prevent key repeat during
long-press timer), but we send a synthetic key press and release to the
client that matches the key that was pressed.

BUG: 519339

BUG: 521128

BUG: 521718

BUG: 521772

BUG: 521789

BUG: 521872

BUG: 522024

BUG: 522152

BUG: 522167

CCBUG: 521825

CCBUG: 521902

FIXED-IN: 6.7.2

Resolves: https://invent.kde.org/plasma/plasma-keyboard/-/work_items/71
2026-06-27 14:59:27 -04:00
Kristen McWilliam 10e03f0d4a fix: Don't disable key repeat when diacritics overlay is enabled
When the diacritics long-press overlay is enabled, we were previously
disabling key repeat for the base character to prevent the base
character from being repeated while waiting for the overlay to trigger/a
choice to be selected.

A recent change to fix injected keys (e.g. from a password manager)
not arriving in the correct order extended this repeat-blocking behavior
to all keys that produce commit text:
https://invent.kde.org/plasma/plasma-keyboard/-/merge_requests/131 —
this additionally broke key repeat for spacebar.

This change ensures that all keys that produce commit text (including
space) are still committed via commit_string for ordering consistency
(e.g. password manager injection), while also simulating key repeat for
_both_ diacritic and non-diacritic keys via the controller's internal
timer so that auto-repeat behavior is retained even while the raw key
events are consumed and don't reach the client.
2026-06-21 10:47:44 -04:00
Kristen McWilliam a3b7961416 test: resolve clang-tidy warning about integer division
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/integer-division.html
2026-06-19 14:24:29 -04:00
Kristen McWilliam da31443563 test: Add doc comments for touch test functions 2026-06-19 14:24:29 -04:00
Aleix Pol 025ae89ce5 test: Add a test for keyboard navigation 2026-06-18 13:52:56 -04:00
Aleix Pol eaff859993 test: Allow testing touch input
Guesses where the Q will be and taps it.
2026-06-18 13:52:56 -04:00
Kristen McWilliam 5e58eab520 fix: improve reliability of dead key and compose key handling w/ overlay
We were trying to track the compose state ourselves while still passing
the keys through to the compositor, but this is problematic because some
applications/toolkits (for example Signal, Telegram, and Chromium have
been identified) will send a surrounding_text changed event for the
compose/dead key (to e.g. visually show a change), but this
surrounding_text change event caused our tracking to think the compose
sequence was finished or cancelled, aborting the sequence and breaking
the compose/dead key handling.

Instead we use the actual xkbcommon state machine to keep track of the
compose state (which makes better sense than trying to implement our
own), and do not pass such compose keys through to the compositor at
all; thus we don't have to worry about misbehaving applications/toolkits
sending unexpected events that break the key handling.

Tests for both dead keys and compose sequences have been added.

BUG: 518141

BUG: 519339

BUG: 520410

BUG: 520344
2026-06-14 15:51:32 +00:00
Kristen McWilliam e3443651c7 test: typing quickly should not trigger the long-press overlay 2026-05-14 12:56:47 -04:00
Kristen McWilliam 1f0cc0d118 test: use max long-press threshold to avoid potential flakiness in CI 2026-05-14 12:56:47 -04:00
Kristen McWilliam c107aa78fb test: add diacritics keyboard navigation test 2026-05-14 12:56:47 -04:00
Kristen McWilliam 608a408ae9 test: add short press doesn't show diacritics overlay 2026-05-14 12:56:47 -04:00
Kristen McWilliam 2bf25638b2 test: fix conflicting HOME for tests
QStandardPaths::setTestModeEnabled & setting the HOME var were fighting
each other, and the child process only inherits the HOME var. Now they
both see the same temp directory as HOME.

This also fixes the test incorrectly expecting "á" instead of "à" for
the long press of "a" with the it_IT locale; now the test is correct.
2026-05-05 16:34:43 +00:00
Aleix Pol 4f31fc7944 autotests: Introduce a new test
Creates a QtWayland Compositor-based test that runs plasma-keyboard and
interacts with it and sees that it behaves as expected.

Current test is very bare but can be improved as needed.
2026-04-11 22:00:26 +02:00