librime-lua
librime-lua copied to clipboard
如何輸入指定編碼顯示切換菜單候選項?
例如輸入menu顯示ctrl+`同樣效果的方案選單候選框,這樣可以減少快捷鍵的依賴與衝突,應該有提供實現接口吧?求用lua實現方法
我會建羲 加上 /menu 把 輸入法 排開 就可以加上許多 command lua_processor lua_translator 都可以 各有不同的嚮應方式
- lua_processor (簡單) 直接用processor 檢 input and commit char
/menu processor_func 時 input = /menu key:repr == " " ---> context:clear() ; action ; return accepted action 會是個問題 你要的功能 Switcher( processor ' translator ) 在engine processor_ 沒人調得到 ,目前 類似 keybinder 正在PR中 engine:rocess_key("Control+ keyname )
-
lua_translator & lua_processor 或再加Tag 限制 translator 次
if seg:has_tag("command") then
if input== "/menu" then yaild( candidate("command", seg.start,seg_end, "menu", funcname) yield( candidate("command", ........ ) end processor_function ()