Follow Plasma's virtual keyboard setting
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>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#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();
|
||||
};
|
||||
Reference in New Issue
Block a user