openharmony 鸿蒙 inputmethod-hdc-commands-guide

2026-08-25 浏览 (1)

Managing the Input Method Using hdc Commands

NOTE

The IME tool is supported since API version 20.

How to Use

hdc shell ime [option] [parameter]

Commands

OptionParameterDescription
-ebundle [-b /-f]Enables an input method as a specified mode. If -b or -f is not set, -b defaults to the basic mode, and -f indicates the full experience mode.
Note: The enabling status of the preset default input method cannot be changed.
-dbundleDisables a specified input method.
Note: The preset default input method cannot be disabled.
-sbundleSwitches to a specified input method.
Note: You are not allowed to switch to another input method when the screen is locked or the password is being entered.
-gNAObtains the current input method.
-lNALists all input methods.
-hNADisplays the help information.

Managing Input Methods Using IME Tool

  1. Enabling an input method. You can enable a third-party input method as basic mode or full experience mode.

     # Input: Use an hdc command to enable an input method.
     # Processing: Check if it is an hdc shell command, and call the corresponding system API for managing input methods.
     # Output: The effect is equivalent to a direct API call.
     # Basic mode
     hdc shell ime -e com.xxx.yyy 
     # Full experience mode
     hdc shell ime -e com.xxx.yyy -f
    
  2. Disabling an input method. You can disable a third-party input method.

     # Input: Use an hdc command to disable an input method.
     # Processing: Check if it is an hdc shell command, and call the corresponding API for disabling.
     # Output: The effect is equivalent to a direct API call.
     hdc shell ime -d com.xxx.yyy
    
  3. Switching to a specified input method.

     # Input: Use an hdc command to switch the input method.
     # Processing: Check if it is an hdc shell command, and call the corresponding API for switching.
     # Output: The effect is equivalent to a direct API call.
     hdc shell ime -s com.xxx.yyy
    
  4. Obtaining the current input method.

     # Input: Use an hdc command to obtain the current input method.
     # Processing: Check if it is an hdc shell command, and call the corresponding API for obtaining.
     # Output: The effect is equivalent to a direct API call.
     hdc shell ime -g
    
  5. Listing all input methods. The enabling status of the preset default input method is not displayed.

     # Input: Use an hdc command to list all input methods.
     # Processing: Check if it is an hdc shell command, and call the corresponding API for listing.
     # Output: The effect is equivalent to a direct API call.
     hdc shell ime -l
    
  6. Displaying the help information.

     # Input: Use an hdc command to display the help information.
     # Output: Display the help information.
     hdc shell ime -h
    

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 use-inputmethod-in-custom-edit-box-ndk

openharmony 鸿蒙 input-method-subtype-guide

openharmony 鸿蒙 switch-inputmethod-guide

openharmony 鸿蒙 inputmethod-immersive-mode-guide

openharmony 鸿蒙 ime-kit-intro

openharmony 鸿蒙 Readme-EN

openharmony 鸿蒙 use-inputmethod-in-not-focusable-window

openharmony 鸿蒙 inputmethod-application-guide

openharmony 鸿蒙 use-inputmethod-in-custom-edit-box

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/1jP1Ykpe