osfans / trime

同文安卓輸入法平臺3.x/Android-rime/Rime Input Method Engine for Android
http://osfans.github.io/trime/
GNU General Public License v3.0
3.08k stars 372 forks source link

[docs] Any document about liquid_keyboard #1269

Open Freed-Wu opened 7 months ago

Freed-Wu commented 7 months ago

I search clipboard and draft, as a result, I found they seem to be related to liquid_keyboard. However I cannot find any document about liquid_keyboard in https://github.com/osfans/trime/wiki/trime.yaml-%E8%A9%B3%E8%A7%A3

Can I have

switches:
  # 这个按键用来切换键盘布局(在主键盘、数字键盘、英文键盘之间轮换)
  - options: [_keyboard_.default, _keyboard_number, _keyboard_letter, _keyboard_clipboard]
    states: [默认, 123, abc, clipboard]

?

goofyz commented 7 months ago

Yes, you can.

In trime.yaml, there are preset_keys like liquid_keyboard_emoji and liquid_keyboard_emoji. You can add them to switch like

  - options: [_key_liquid_keyboard_emoji, liquid_keyboard_clipboard,_keyboard_mini]
    states: ["😃️", "CLIP", "🎹"]

You can add a custom key to preset_keys as well.

Freed-Wu commented 7 months ago

I try however it cannot work for me :cry: :

double_pinyin_mspy.custom.yaml:

---
patch:
  __include: emoji_suggestion:/patch
  switches/@before 0:
    name: keyboard
    reset: 0
    options:
      - _keyboard_.default
      - liquid_keyboard_clipboard
      - liquid_keyboard_draft
      - _keyboard_kao_happy
    states:
      - "⌨️\uFE0E"
      - 📋
      - 📝
      - ^_^

Screenshot_20240226_150413

The keyboard still be mini (connected bluetooth keyboard) not clipboard.

goofyz commented 7 months ago

Sorry, you need to add _key_ as a prefix to preset_keys. The options should be

    options:
      - _keyboard_.default
      - _key_liquid_keyboard_clipboard
      - _key_liquid_keyboard_draft
      - _keyboard_kao_happy

For liquid_keyboard_draft, you need to add a preset_key to your trime.custom.yaml yourself as it is not built-in.

patch: 
  "preset_keys/liquid_keyboard_draft": { label: "Draft", send: function, command: liquid_keyboard, option: "草稿"}
Freed-Wu commented 7 months ago

Thanks. _key_ is needed.

I found it will override candidate and I must press 返回 to return original candidate. Can we keep original candidate when we use clipboard keyboard?

Original candidate:

Screenshot_20240226_160807

Aftre switching to clipboard:

Screenshot_20240226_160608

Screenshot_20240226_161018

goofyz commented 7 months ago

There is no way. It is programmed to hide "switch" & "candidate" when switched to liquid keyboard.