Skip to content
New issue

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

修改 context.input 要注意 ,會觸發 update_notifier #264

Open
shewer opened this issue Aug 15, 2023 · 1 comment
Open

修改 context.input 要注意 ,會觸發 update_notifier #264

shewer opened this issue Aug 15, 2023 · 1 comment

Comments

@shewer
Copy link
Contributor

shewer commented Aug 15, 2023

只要是 更動 context.input 就會觸發 update_notifier --> Engine::Compose()
最好是在 確認更動時才 變更,或是須要 compose() 刷新 接着處理時
可在 librime/src/context.cc 找有呼叫 "update_notifier_(this)" 的member function

   local input = context.input
   input = ...
   .....
   if ... then 
       input = ....
       conetxt.input = input  -- 觸發 Compose()
   elseif ...
      context:input_push( "x") -- 觸發 Compose()
   else 
    ...
   end
---------- 多次修改新造成多次觸發
   context.input = context.input:low()
   context.input = context.input .. "-"
   context.input = context.input:match(' ...')
   context:push_input( ...)
----------
    local input = context.input
    input = input .. "-"
    input = input:match('...')
    input = input .. "..."
    context.input = input

@groverlynn
Copy link
Contributor

相当于你敲了键盘,但希望输入法没反应?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants