2022-08-17 21:15:07 +08:00
# inputmethod_imf
2021-09-14 12:24:10 +00:00
2021-09-23 20:49:29 +08:00
#### Introduction
2021-09-14 12:24:10 +00:00
2021-09-15 14:32:33 +08:00
Input Method Framework, is used to connect the application and input method. the application can input text through the input method
2021-09-14 12:24:10 +00:00
2021-09-24 20:19:22 +08:00
**图 1** 子系统架构图< a name = "fig143011012341" > < / a >

2021-09-23 20:49:29 +08:00
#### Warehouse path
2021-09-14 12:24:10 +00:00
2022-08-17 21:15:07 +08:00
/base/inputmethod/imf
2021-09-14 12:24:10 +00:00
2021-09-23 20:49:29 +08:00
#### Introduction to framework code
2021-09-14 12:24:10 +00:00
2021-09-15 14:32:33 +08:00
The input method framework currently has four modules, as follows:
2021-09-14 12:24:10 +00:00
2021-09-15 14:32:33 +08:00
1. Application client
2021-09-15 20:33:09 +08:00
2022-08-17 21:15:07 +08:00
Path: /base/inputmethod/imf/frameworks/inputmethod_controller
2021-09-15 20:33:09 +08:00
2021-09-15 14:32:33 +08:00
Function: realize the service delivery of application and input method framework, including the binding between application and input method service, application display and hiding request for input method, etc
2021-09-14 12:24:10 +00:00
2021-09-15 14:32:33 +08:00
2. Input method client
2021-09-15 20:33:09 +08:00
2022-08-17 21:15:07 +08:00
Path: /base/inputmethod/imf/frameworks/inputmethod_ability
2021-09-15 20:33:09 +08:00
2021-09-15 14:32:33 +08:00
Function: the intermediate bridge between input method framework service and input method delivery, including monitoring the current status of input method, etc
2021-09-14 12:24:10 +00:00
2021-09-15 14:32:33 +08:00
3. Input method service
2021-09-15 20:33:09 +08:00
2022-08-17 21:15:07 +08:00
Path: /base/inputmethod/imf/services
2021-09-15 20:33:09 +08:00
2021-09-15 14:32:33 +08:00
Function: as the core of the input method framework, the main processing logic of the input method is completed here
4. Input method JS interface
2021-09-15 20:33:09 +08:00
2022-08-17 21:15:07 +08:00
Path: /base/inputmethod/imf/interfaces/kits/JS
2021-09-15 20:33:09 +08:00
2021-09-15 14:32:33 +08:00
Function: the temporarily exposed JS interface is mainly reserved for calling input methods
2021-09-23 20:49:29 +08:00
#### Main functions supported by the framework
2021-09-15 14:32:33 +08:00
1. Click in the edit attribute control to invoke the default input method application through the input method framework
2021-09-15 20:33:09 +08:00
2021-09-15 14:32:33 +08:00
2. Typing can be carried out through the input method application, and characters can be input to the application client on the screen
2021-09-23 20:49:29 +08:00
#### Debugging method
1. Compile command
2022-08-17 21:15:07 +08:00
./build.sh --product-name (Fill in the specific product name, such as: Hi3516DV300) --build-target imf
2021-09-23 20:49:29 +08:00
2. push so file
2022-08-17 21:15:07 +08:00
in $root\out\ohos-arm-release\inputmethod\imf, push libinputmethod_client.z.so libinputmethod_ability.z.so
libinputmethod_service.z.so libinputmethod_para.z.so to system/lib, and push libinputmethodengine.z.so libinputmethod.z.so to system/lib/module, and make sure the six so files is readable at least.
2021-09-23 20:49:29 +08:00
3. reboot
2022-05-09 00:35:21 +00:00
#### Participation contribution
2021-09-15 14:32:33 +08:00
1. Fork warehouse
2. Submission code
3. Create a new pull request
4. Commit is complete