public class SoftKeyBoardController extends Object
This controller offers the following functions:
SystemCapability.Accessibility#ABILITY| 构造器 | 说明 |
|---|---|
SoftKeyBoardController(int connectionId,
Object lock) |
A constructor used to create a
SoftKeyBoardController instance based on the connection ID and lock. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
addListener(SoftKeyBoardListener listener) |
Adds a
SoftKeyBoardListener instance to observe changes of the soft keyboard's show/hide mode. |
boolean |
deleteListener(SoftKeyBoardListener listener) |
Removes the specified
SoftKeyBoardListener instance. |
int |
getShowMode() |
Obtains the show/hide mode of this soft keyboard.
|
boolean |
setShowMode(int showMode) |
Sets the show/hide mode of the soft keyboard.
|
public SoftKeyBoardController(int connectionId,
Object lock)
SoftKeyBoardController instance based on the connection ID and lock.connectionId - Indicates the connection ID used to create SoftKeyBoardController.lock - Indicates the lock used to create SoftKeyBoardController.public void addListener(SoftKeyBoardListener listener)
SoftKeyBoardListener instance to observe changes of the soft keyboard's show/hide mode.listener - Indicates the listener to add.public boolean deleteListener(SoftKeyBoardListener listener)
SoftKeyBoardListener instance.listener - Indicates the listener to remove.true if the listener is successfully removed; returns false otherwise.public int getShowMode()
0 indicates that the soft keyboard is
shown, value 1 indicates that the soft keyboard is hidden, and value 2 indicates that the soft
keyboard is still shown when an external keyboard is connected.AccessibleAbility.SHOW_MODE_AUTO,
AccessibleAbility.SHOW_MODE_HIDE,
AccessibleAbility.SHOW_MODE_IGNORE_HARD_KEYBOARDpublic boolean setShowMode(int showMode)
showMode - Indicates the show/hide mode to set. Value AccessibleAbility#SHOW_MODE_AUTO indicates
that the soft keyboard is shown, value AccessibleAbility#SHOW_MODE_HIDE indicates that
the soft keyboard is hidden,and value AccessibleAbility#SHOW_MODE_IGNORE_HARD_KEYBOARD
indicates that the soft keyboard is still shown when an external keyboard is connected.true if the setting is successful; returns false otherwise.