1e41f4b71Sopenharmony_ci# @ohos.inputMethodList (Input Method List) 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciThe **inputMethodList** module is oriented to system applications and input method applications. It provides APIs for implementing an input method list. This list displays the default input method subtypes and third-party input methods. Users can use this list to switch from the default input method to another input method. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> The initial APIs of this module are supported since API version 11. Updates will be marked with a superscript to indicate their earliest API version. 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci## Modules to Import 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci```ts 12e41f4b71Sopenharmony_ciimport { inputMethod } from '@kit.IMEKit'; 13e41f4b71Sopenharmony_ci``` 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci## Child Components 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ciNot supported 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci## Attributes 20e41f4b71Sopenharmony_ciThe [universal attributes](../apis-arkui/arkui-ts/ts-universal-attributes-size.md) are not supported. 21e41f4b71Sopenharmony_ci 22e41f4b71Sopenharmony_ci## InputMethodListDialog 23e41f4b71Sopenharmony_ci 24e41f4b71Sopenharmony_ciInputMethodListDialog({controller: CustomDialogController, patternOptions?: PatternOptions}) 25e41f4b71Sopenharmony_ci 26e41f4b71Sopenharmony_ciImplements a dialog box showing the input method list. 27e41f4b71Sopenharmony_ci 28e41f4b71Sopenharmony_ci**Decorator type**: @CustomDialog 29e41f4b71Sopenharmony_ci 30e41f4b71Sopenharmony_ci**System capability**: SystemCapability.MiscServices.InputMethodFramework 31e41f4b71Sopenharmony_ci 32e41f4b71Sopenharmony_ci**Parameters** 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ci| Name| Type| Mandatory| Decorator| Description| 35e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | -------- | 36e41f4b71Sopenharmony_ci| controller | [CustomDialogController](../apis-arkui/arkui-ts/ts-methods-custom-dialog-box.md#customdialogcontroller) | Yes| - | Controller for the dialog box showing the input method list.| 37e41f4b71Sopenharmony_ci| patternOptions | [PatternOptions](#patternoptions) | No| - | Input method pattern options (for the default input method only).| 38e41f4b71Sopenharmony_ci 39e41f4b71Sopenharmony_ci## PatternOptions 40e41f4b71Sopenharmony_ci 41e41f4b71Sopenharmony_ci**System capability**: SystemCapability.MiscServices.InputMethodFramework 42e41f4b71Sopenharmony_ci 43e41f4b71Sopenharmony_ci| Name| Type| Read-Only| Optional| Description| 44e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | -------- | 45e41f4b71Sopenharmony_ci| defaultSelected<sup>11+</sup> | number | Yes| Yes| Optional. Default selected pattern.| 46e41f4b71Sopenharmony_ci| patterns<sup>11+</sup> | Array<[Pattern](#pattern)> | Yes| Yes| Mandatory. Resource of the pattern option.| 47e41f4b71Sopenharmony_ci| action<sup>9+</sup> | function | Yes| Yes| Mandatory. Callback invoked when the pattern option changes.| 48e41f4b71Sopenharmony_ci 49e41f4b71Sopenharmony_ci## Pattern 50e41f4b71Sopenharmony_ci 51e41f4b71Sopenharmony_ci**System capability**: SystemCapability.MiscServices.InputMethodFramework 52e41f4b71Sopenharmony_ci 53e41f4b71Sopenharmony_ci| Name| Type| Read-Only| Optional| Description| 54e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | -------- | 55e41f4b71Sopenharmony_ci| icon<sup>11+</sup> | [Resource](../apis-arkui/arkui-ts/ts-types.md#resource) | Yes| Yes| Mandatory. Default icon.| 56e41f4b71Sopenharmony_ci| selectedIcon<sup>11+</sup> | [Resource](../apis-arkui/arkui-ts/ts-types.md#resource) | Yes| Yes| Mandatory. Icon for the selected option.| 57e41f4b71Sopenharmony_ci 58e41f4b71Sopenharmony_ci## Events 59e41f4b71Sopenharmony_ci 60e41f4b71Sopenharmony_ciThe [universal events](../apis-arkui/arkui-ts/ts-universal-events-click.md) are not supported. 61e41f4b71Sopenharmony_ci 62e41f4b71Sopenharmony_ci## Example 63e41f4b71Sopenharmony_ci 64e41f4b71Sopenharmony_ci```ts 65e41f4b71Sopenharmony_ciimport { InputMethodListDialog, Pattern, PatternOptions } from '@kit.IMEKit'; 66e41f4b71Sopenharmony_ci 67e41f4b71Sopenharmony_ci@Entry 68e41f4b71Sopenharmony_ci// Configure the component. 69e41f4b71Sopenharmony_ci@Component 70e41f4b71Sopenharmony_ciexport struct settingsItem { 71e41f4b71Sopenharmony_ci @State defaultPattern: number = 1; 72e41f4b71Sopenharmony_ci private oneHandAction: PatternOptions = { 73e41f4b71Sopenharmony_ci defaultSelected: this.defaultPattern, 74e41f4b71Sopenharmony_ci patterns: [ 75e41f4b71Sopenharmony_ci { 76e41f4b71Sopenharmony_ci icon: $r('app.media.hand_icon'), 77e41f4b71Sopenharmony_ci selectedIcon: $r('app.media.hand_icon_selected') 78e41f4b71Sopenharmony_ci }, 79e41f4b71Sopenharmony_ci { 80e41f4b71Sopenharmony_ci icon: $r('app.media.hand_icon1'), 81e41f4b71Sopenharmony_ci selectedIcon: $r('app.media.hand_icon_selected1') 82e41f4b71Sopenharmony_ci }, 83e41f4b71Sopenharmony_ci { 84e41f4b71Sopenharmony_ci icon: $r('app.media.hand_icon2'), 85e41f4b71Sopenharmony_ci selectedIcon: $r('app.media.hand_icon_selected2'), 86e41f4b71Sopenharmony_ci }], 87e41f4b71Sopenharmony_ci action:(index: number)=>{ 88e41f4b71Sopenharmony_ci console.info(`pattern is changed, current is ${index}`); 89e41f4b71Sopenharmony_ci this.defaultPattern = index; 90e41f4b71Sopenharmony_ci } 91e41f4b71Sopenharmony_ci }; 92e41f4b71Sopenharmony_ci private listController: CustomDialogController = new CustomDialogController({ 93e41f4b71Sopenharmony_ci builder: InputMethodListDialog({ patternOptions: this.oneHandAction }), 94e41f4b71Sopenharmony_ci customStyle: true, 95e41f4b71Sopenharmony_ci maskColor: '#00000000' 96e41f4b71Sopenharmony_ci }); 97e41f4b71Sopenharmony_ci 98e41f4b71Sopenharmony_ci build() { 99e41f4b71Sopenharmony_ci Column() { 100e41f4b71Sopenharmony_ci Flex({ direction: FlexDirection.Column, 101e41f4b71Sopenharmony_ci alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { 102e41f4b71Sopenharmony_ci Text("Input Method List").fontSize(20) 103e41f4b71Sopenharmony_ci } 104e41f4b71Sopenharmony_ci } 105e41f4b71Sopenharmony_ci .width("13%") 106e41f4b71Sopenharmony_ci .id('bindInputMethod') 107e41f4b71Sopenharmony_ci .onClick((event?: ClickEvent) => { 108e41f4b71Sopenharmony_ci this.listController.open(); 109e41f4b71Sopenharmony_ci }) 110e41f4b71Sopenharmony_ci } 111e41f4b71Sopenharmony_ci} 112e41f4b71Sopenharmony_ci``` 113