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

用快捷键切换单选状态组 #555

Closed
wants to merge 4 commits into from
Closed

Conversation

lotem
Copy link
Member

@lotem lotem commented Jun 16, 2022

Pull request

Issue tracker

Fixes will automatically close the related issue

Fixes #554

Feature

Describe feature of pull request

DONE:

状态选项里的单选状态组现在不支持通过快捷键切换,用不上这么好的文字提示,我准备把快捷键单选功能做好。

TODO:

另外,我打算把 Control+Shift+2 等快捷键
https://github.com/rime/rime-prelude/blob/master/key_bindings.yaml#L45

    - { when: always, accept: Control+Shift+2, toggle: ascii_mode }
    - { when: always, accept: Control+Shift+3, toggle: full_shape }
    - { when: always, accept: Control+Shift+4, toggle: simplification }
    - { when: always, accept: Control+Shift+5, toggle: extended_charset }

重新定义为

    - { when: always, accept: Control+Shift+2, toggle: '@0' }
    - { when: always, accept: Control+Shift+3, toggle: '@1' }
    - { when: always, accept: Control+Shift+4, toggle: '@2' }
    - { when: always, accept: Control+Shift+5, toggle: '@3' }

指改变方案中 switches/@0 等处定义的状态。这样的配置就通用了。兼容方案自定义的状态。

@x 如果不是开关而是单项选择状态组,最好不必改动词 toggle,让他轮换到下一个状态。免得还得专门改快捷键配置。

Unit test

  • Done

Manual test

  • Done

Code Review

  1. Unit and manual test pass
  2. GitHub Action CI pass
  3. At least one contributor reviews and votes
  4. Can be merged clean without conflicts
  5. PR will be merged by rebase upstream base

Additional Info

@lotem lotem changed the title Switches (work in progress) 用快捷键切换单选状态组 (work in progress) Jun 16, 2022
using toggle, set_option, unset_option commands.

`toggle` behaves like round robin in a radio group no matter which option is
given or whether it is the selected option.
`set_option` also unset other options in the same radio group.
`unset_option` resets radio selection to the default option if the given option
is selected, or does nothing if the given option is deselected.
@lotem lotem closed this Jun 29, 2022
@lotem lotem deleted the switches branch June 29, 2022 15:17
@lotem
Copy link
Member Author

lotem commented Jun 29, 2022

Submitted as 5e8aca2

lotem referenced this pull request Jun 29, 2022
using toggle, set_option, unset_option commands.

`toggle` behaves like round robin in a radio group no matter which option is
given or whether it is the selected option.
`set_option` also unset other options in the same radio group.
`unset_option` resets radio selection to the default option if the given option
is selected, or does nothing if the given option is deselected.
@lotem lotem changed the title 用快捷键切换单选状态组 (work in progress) 用快捷键切换单选状态组 Jun 29, 2022
@tshu-w
Copy link
Contributor

tshu-w commented Sep 16, 2023

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

Successfully merging this pull request may close these issues.

状态变更的文字提示,应该还有后续
2 participants