Type into any window: fake input when no text field is focused

- KWinFakeInput (org_kde_kwin_fake_input v6, offered by KWin to the
  input-method process): keysyms with real modifier keys held
- The KWin backend uses the input method in text fields and fake input
  everywhere else, so shortcuts, terminals and the desktop get keys
- Text rules (auto-capitalization, double-space) only apply in fields
- Always Show setting keeps the keyboard up without a text field

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-14 21:59:32 +02:00
co-authored by Claude Opus 5.5
parent ba2f17d665
commit f816135162
20 changed files with 303 additions and 23 deletions
+5
View File
@@ -1,5 +1,6 @@
#pragma once
#include "KWinFakeInput.h"
#include "TextBackend.h"
#include "InputMethodProtocol.h"
@@ -28,6 +29,9 @@ protected:
void zwp_input_method_v1_deactivate(::zwp_input_method_context_v1 *context) override;
};
// Types into the focused text field through the input method; with none
// focused, sends key events to the focused window through fake input, so the
// keyboard works everywhere (shortcuts, terminals, the desktop).
class KWinInputMethod : public TextBackend
{
Q_OBJECT
@@ -55,5 +59,6 @@ private:
void deactivate();
KWinInputMethodGlobal m_global;
KWinFakeInput m_fakeInput;
std::unique_ptr<KWinInputContext> m_context;
};