mirror of
https://github.com/qingjian-team/qingjian.git
synced 2026-11-24 00:05:28 +00:00
Linux 第一阶段:Rust Server + 薄 Fcitx5 插件 + 用户目录安装,候选窗用 Fcitx5 自带面板。 目前只支持源码安装、手动启动 Server;自绘候选窗、自动启动与打包在后续阶段。
22 lines
818 B
C++
22 lines
818 B
C++
//! 默认面板回归使用的无应用输入上下文。
|
|
#pragma once
|
|
#include <fcitx/inputcontext.h>
|
|
#include <functional>
|
|
class Context final : public fcitx::InputContext {
|
|
public:
|
|
explicit Context(fcitx::InputContextManager &manager) : InputContext(manager, "panel-test") { created(); }
|
|
~Context() override { destroy(); }
|
|
const char *frontend() const override { return "test"; }
|
|
std::string committed;
|
|
|
|
std::function<void()> onPreedit;
|
|
protected:
|
|
void commitStringImpl(const std::string &text) override { committed += text; }
|
|
void deleteSurroundingTextImpl(int, unsigned int) override {}
|
|
void forwardKeyImpl(const fcitx::ForwardKeyEvent &) override {}
|
|
void updatePreeditImpl() override {
|
|
auto callback = std::move(onPreedit);
|
|
if (callback) callback();
|
|
}
|
|
};
|