Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Mode_switch commits raw text or the first candidate #1514

Open
jpeninput opened this issue Nov 22, 2024 · 1 comment
Open

Mode_switch commits raw text or the first candidate #1514

jpeninput opened this issue Nov 22, 2024 · 1 comment

Comments

@jpeninput
Copy link

jpeninput commented Nov 22, 2024

edit1: pinpointed problem to Mode_switch's behavior
edit2: added related src
edit3: editedrelated src

摘要 / Summary

Clicking on a Mode_switch button ascii_mode toggle button commits raw text (from "en" mode to non-"en" mode), or the first candidate (from non-"en" mode to "en" mode).

  • Reasons against this behavior,

    • In non-"en" mode, when a user clicks an "en" switch button, he may not wish to commit anything, (or he may wish to commit the second candidate). Current behavior commits the first candidate.
    • In "en" mode, when a user clicks a non-"en" switch button, he may wish all entered characters remains in candidate window non-commited. For example, when a custom yaml with LUA is used to processes those characters. Current behavior requires deleting unwanted committed text with backspace and re-entering.
    • Consistent behavior with other rimes.
  • Regression

    • on Latest nightly (de303b3)
    • on v3.3.0
    • not on v.3.2.19 (does not commit raw text)
    • not on latest rime/weasel
  • Possible workaround (not tested yet)

    • Use virtual functional key. For example Button2: text: "{Control}"

重现步骤 / Steps to Reproduce

Example trime.yaml Button1: send: Mode_switch states: ["jp", "en"] toggle: ascii_mode

Scenario 1

  1. "en" mode.
  2. Enter "SU".
  3. Candidate window shows "SU"
  4. Click the Mode_switch button.
  5. Commits "SU" to editor. Changes ascii_mode. Candidate window is empty.
  6. To enter "す". Remove unwanted "SU" on screen with backspace. Enter "SU", select "す".

Scenario 2

  1. non-"en" mode ("jp" mode).
  2. Enter "SU".
  3. Candidate window shows "SU" and all candidates "す"...
  4. Click the Mode_switch button.
  5. Commits "す" to editor. Changes ascii_mode. Candidate window is empty.
  6. To enter "SUPER" in candidate window. Remove unwanted "す" on screen with backspace, then re-enter "SUPER" (to be parsed by a custom LUA).

预期行为 / Expected Behavior

Changes ascii_mode only. "SU" stays on candidate window.

日志 / Log

No response

截图 / Screenshot

No response

附加信息 / Additional Context

related src (not sure)

系统版本 / OS Version

android 12

应用版本 / App Version

v3.3.0+

构建信息 / Build Information

not applicable

@jpeninput jpeninput changed the title ascii_mode commits raw text. Mode_switch commits raw text or the first candidate Nov 22, 2024
@WhiredPlanck
Copy link
Collaborator

Welcome, new user. I confirm this issue, let me take time to investigate.

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

No branches or pull requests

2 participants