KWin activates the input method for every text field; its policy (the tray toggle) only gates the input panel, which sloposk doesn't use. sloposk now asks KWin over D-Bus whether a focused field should show the keyboard: never when off, only after touch or a pen by default. "Always Show" and D-Bus Show/Toggle still show it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
781 B
C++
26 lines
781 B
C++
#pragma once
|
|
|
|
#include <QObject>
|
|
|
|
#include <functional>
|
|
|
|
// KWin's virtual keyboard policy (the tray toggle, System Settings →
|
|
// Virtual Keyboard): KWin activates the input method for every text field
|
|
// and the policy only gates its input panel, which sloposk doesn't use, so
|
|
// sloposk asks it over org.kde.KWin /VirtualKeyboard instead.
|
|
class KWinVirtualKeyboard : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit KWinVirtualKeyboard(QObject *parent = nullptr);
|
|
|
|
// Calls `answer` with whether a field focused now should show the
|
|
// keyboard: never when it's off, only after touch or a pen in the
|
|
// default mode. True if KWin can't be asked.
|
|
void askShowOnActive(QObject *context, std::function<void(bool)> answer);
|
|
|
|
Q_SIGNALS:
|
|
void modeChanged();
|
|
};
|