chewing / libchewing

libchewing - The intelligent phonetic input method library
https://chewing.im/
GNU Lesser General Public License v2.1
359 stars 90 forks source link

New APIs for remappable keybindings #630

Open kanru opened 1 month ago

kanru commented 1 month ago

Is your feature request related to a problem? Please describe.

Currently each chewing_handle_X API has predefined functionality, yet they are not documented. The behaviors are documented in the usage document only. So when IM want to disable Shift+Space for fullwidth toggle, or other behaviors, we have to provide specific options.

Describe the solution you'd like

Define public Chewing state machine states, and actions, and default key bindings. Then provide new set of APIs to configure the key bindings.

For example,

State Action Default Key Binding
Entering Input Any
Entering Toggle Fullwidth Shift + Space
Selecting Select 0 0

The selKeys option can be rebuild on top of this new feature.

Describe alternatives you've considered

Not at this moment.

Additional context

605