hchunhui / librime-lua

Extending RIME with Lua scripts
BSD 3-Clause "New" or "Revised" License
304 stars 43 forks source link

能加优化一下lua 加个能切换指定方案的方法么? #126

Open OnchiuLee opened 3 years ago

OnchiuLee commented 3 years ago

能加优化一下lua组件 加个能切换指定方案的方法么?非切换下一个方案,因为有时候快捷键太不好用了,没有使用指定编码快速切换指定方案实在

shewer commented 3 years ago

目前 librime-lua 已有 method https://github.com/hchunhui/librime-lua/blob/15bd231e46fb5c0c7dd8a81d2d30fee9a838f0fa/src/types.cc#L403-L418

https://github.com/hchunhui/librime-lua/blob/15bd231e46fb5c0c7dd8a81d2d30fee9a838f0fa/src/types.cc#L588-L600

  local schema= Schema("cangjie5")
  env.engine:apply_schema(schema) 

lua component 是在方案下 你可以試試,只是 方案和方案`之間 都要有 lua component 才有用 , 不然跑過去就回不來了, 這也增加 方案與方案間整合的複雜度

覺得 實現這功能 花費時間 -- 使用度 效益不好

目前 rime 切換 方案
1 key_binder { when: always accept: Control+F10 , select: cangjie5 }
2 rime 自載入的 Switch ( Control+` or F4) 這 compoment 太複雜 https://github.com/rime/librime/blob/a1203fce1ebca70cc04b964d136ae6c4331708e5/src/rime/engine.cc#L287

OnchiuLee commented 3 years ago

目前 librime-lua 已有 method https://github.com/hchunhui/librime-lua/blob/15bd231e46fb5c0c7dd8a81d2d30fee9a838f0fa/src/types.cc#L403-L418

https://github.com/hchunhui/librime-lua/blob/15bd231e46fb5c0c7dd8a81d2d30fee9a838f0fa/src/types.cc#L588-L600


  local schema= Schema("cangjie5")

  env.engine:apply_schema(schema) 

lua component 是在方案下

你可以試試,只是 方案和方案`之間 都要有 lua component 才有用 , 不然跑過去就回不來了, 這也增加 方案與方案間整合的複雜度

覺得 實現這功能 花費時間 -- 使用度 效益不好

目前 rime 切換 方案

1  key_binder     { when: always  accept: Control+F10 , select: cangjie5 }   

2   rime 自載入的 Switch  ( Control+` or F4)  這 compoment 太複雜 

https://github.com/rime/librime/blob/a1203fce1ebca70cc04b964d136ae6c4331708e5/src/rime/engine.cc#L287

方法是有 好像有问题 能短暂切换 但打不了几个字就卡一下就自动跳回之前的方案了

shewer commented 3 years ago

查 LOG 好奇問一下 切換方案的目的爲何?? 切換時機 熱鍵不好用? 能不能 把 方案 合拼 再用 script 切換 tag