We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#include "rime_api.h" void print_commit_text(RimeSessionId session_id, RimeApi* rime_api) { RimeCommit commit = {0}; if (rime_api->get_commit(session_id, &commit)) { std::cout << "Commit Text: " << commit.text << std::endl; } rime_api->free_commit(&commit); } int main() { // 获取 Rime API RimeApi* rime_api = rime_get_api(); if (!rime_api) { std::cerr << "Failed to get Rime API" << std::endl; return -1; } // 设置 RimeTraits RIME_STRUCT(RimeTraits, traits); traits.shared_data_dir = "/home/test/code/test/rime_shared_data"; traits.user_data_dir = "/home/test/code/test/rime_user_data"; rime_api->setup(&traits); // 初始化 Rime rime_api->initialize(&traits); // 创建一个新的会话 RimeSessionId session_id = rime_api->create_session(); if (session_id == 0) { std::cerr << "Failed to create session" << std::endl; return -1; } std::cout << "Session created: " << session_id << std::endl; // 模拟按键输入 rime_api->process_key(session_id, 'n', 0); rime_api->process_key(session_id, 'i', 0); rime_api->process_key(session_id, 'h', 0); rime_api->process_key(session_id, 'a', 0); rime_api->process_key(session_id, 'o', 0); // 模拟按空格键选择第一个候选项 rime_api->process_key(session_id, ' ', 0); // 获取并输出提交的文本 print_commit_text(session_id, rime_api); // 清理会话 rime_api->destroy_session(session_id); // 退出 Rime rime_api->finalize(); return 0; }
请教一下就是我只需要写一个简单的demo就行,想简单的可以在最终的print_commit_text打出你好这2个汉字就行,并且所有需要的配置文件都需要在指定的/home/test/code/test/rime_shared_data或者/home/test/code/test/rime_user_data这种目录下。 看了很多教程但是并没有成功配置,有大佬可以帮忙指导一下吗,非常感谢,主要是想知道比如XXX文件需要放在哪里和文件内容是什么这种,非常感谢。
The text was updated successfully, but these errors were encountered:
參考這幾篇吧。
https://github.com/rime/home/wiki/Configuration https://github.com/rime/home/wiki/RimeWithSchemata#rime-中的數據文件分佈及作用 https://github.com/rime/home/wiki/RimeWithSchemata#詳解輸入方案
總之你得寫
nihao
default.yaml
schema_list
Sorry, something went wrong.
參考這幾篇吧。 https://github.com/rime/home/wiki/Configuration https://github.com/rime/home/wiki/RimeWithSchemata#rime-中的數據文件分佈及作用 https://github.com/rime/home/wiki/RimeWithSchemata#詳解輸入方案 總之你得寫 一個「輸入方案」,定義輸入那些按鍵 nihao 的結果是什麼。 default.yaml,其中的輸入方案列表 schema_list 要列出上述那個輸入方案的 ID。
好的多谢
No branches or pull requests
请教一下就是我只需要写一个简单的demo就行,想简单的可以在最终的print_commit_text打出你好这2个汉字就行,并且所有需要的配置文件都需要在指定的/home/test/code/test/rime_shared_data或者/home/test/code/test/rime_user_data这种目录下。
看了很多教程但是并没有成功配置,有大佬可以帮忙指导一下吗,非常感谢,主要是想知道比如XXX文件需要放在哪里和文件内容是什么这种,非常感谢。
The text was updated successfully, but these errors were encountered: