source
stringlengths
14
113
code
stringlengths
10
21.3k
application-dev\reference\apis-ime-kit\js-apis-inputmethod-extension-ability.md
import { InputMethodExtensionAbility } from '@kit.IMEKit';
application-dev\reference\apis-ime-kit\js-apis-inputmethod-extension-ability.md
import { InputMethodExtensionAbility } from '@kit.IMEKit'; import { Want } from '@kit.AbilityKit'; class InputMethodExt extends InputMethodExtensionAbility { onCreate(want: Want): void { console.info('onCreate, want:' + want.abilityName); } }
application-dev\reference\apis-ime-kit\js-apis-inputmethod-extension-ability.md
import { InputMethodExtensionAbility } from '@kit.IMEKit'; class InputMethodExt extends InputMethodExtensionAbility { onDestroy(): void { console.info('onDestroy'); } }
application-dev\reference\apis-ime-kit\js-apis-inputmethod-extension-context.md
import { InputMethodExtensionContext } from '@kit.IMEKit';
application-dev\reference\apis-ime-kit\js-apis-inputmethod-extension-context.md
import { InputMethodExtensionAbility } from '@kit.IMEKit'; import { Want } from '@kit.AbilityKit'; class InputMethodExtnAbility extends InputMethodExtensionAbility { onCreate(want: Want): void { let context = this.context; } }
application-dev\reference\apis-ime-kit\js-apis-inputmethod-extension-context.md
import { InputMethodExtensionAbility } from '@kit.IMEKit'; import { Want } from '@kit.AbilityKit'; import { BusinessError } from '@kit.BasicServicesKit'; class InputMethodExtnAbility extends InputMethodExtensionAbility { onCreate(want: Want): void { let context = this.context; } onDestroy() { this.contex...
application-dev\reference\apis-ime-kit\js-apis-inputmethod-extension-context.md
import { InputMethodExtensionAbility } from '@kit.IMEKit'; import { Want } from '@kit.AbilityKit'; import { BusinessError } from '@kit.BasicServicesKit'; class InputMethodExtnAbility extends InputMethodExtensionAbility { onCreate(want: Want): void { let context = this.context; } onDestroy() { this.contex...
application-dev\reference\apis-ime-kit\js-apis-inputmethod-extension-context.md
import { InputMethodExtensionAbility } from '@kit.IMEKit'; import { Want } from '@kit.AbilityKit'; import { BusinessError } from '@kit.BasicServicesKit'; class InputMethodExtnAbility extends InputMethodExtensionAbility { onCreate(want: Want): void { let context = this.context; } onDestroy() { let want: W...
application-dev\reference\apis-ime-kit\js-apis-inputmethod-panel.md
import { PanelInfo, PanelType, PanelFlag } from '@kit.IMEKit';
application-dev\reference\apis-ime-kit\js-apis-inputmethod-subtype.md
import { InputMethodSubtype } from '@kit.IMEKit';
application-dev\reference\apis-ime-kit\js-apis-inputmethod-sys.md
import { inputMethod } from '@kit.IMEKit';
application-dev\reference\apis-ime-kit\js-apis-inputmethod-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; let currentIme = inputMethod.getCurrentInputMethod(); try { inputMethod.switchInputMethod(currentIme.name).then(() => { console.info('Succeeded in switching inputmethod.'); }).catch((err: BusinessError) => { console.error(`Failed to switchInputMethod: ...
application-dev\reference\apis-ime-kit\js-apis-inputmethod-sys.md
try { inputMethodSetting.on('imeShow', (info: Array<inputMethod.InputWindowInfo>) => { console.info('Succeeded in subscribing imeShow event.'); }); } catch(err) { console.error(`Failed to unsubscribing imeShow. err: ${JSON.stringify(err)}`); }
application-dev\reference\apis-ime-kit\js-apis-inputmethod-sys.md
try { inputMethodSetting.on('imeHide', (info: Array<inputMethod.InputWindowInfo>) => { console.info('Succeeded in subscribing imeHide event.'); }); } catch(err) { console.error(`Failed to unsubscribing imeHide. err: ${JSON.stringify(err)}`); }
application-dev\reference\apis-ime-kit\js-apis-inputmethod-sys.md
try { inputMethodSetting.off('imeShow'); } catch(err) { console.error(`Failed to unsubscribing imeShow. err: ${JSON.stringify(err)}`); }
application-dev\reference\apis-ime-kit\js-apis-inputmethod-sys.md
try { inputMethodSetting.off('imeHide'); } catch(err) { console.error(`Failed to unsubscribing imeHide. err: ${JSON.stringify(err)}`); }
application-dev\reference\apis-ime-kit\js-apis-inputmethod-sys.md
import { PanelInfo, PanelType, PanelFlag } from '@kit.IMEKit'; let info: PanelInfo = { type: PanelType.SOFT_KEYBOARD, flag: PanelFlag.FLAG_FIXED } try { let result = inputMethodSetting.isPanelShown(info); console.info('Succeeded in querying isPanelShown, result: ' + result); } catch (err) { console.error(`Fa...
application-dev\reference\apis-ime-kit\js-apis-inputmethod-sys.md
import { BusinessError } from '@kit.BasicServicesKit'; let currentIme = inputMethod.getCurrentInputMethod(); try { inputMethodSetting.enableInputMethod(currentIme.name, currentIme.id, inputMethod.EnabledState.BASIC_MODE).then(() => { console.info('Succeeded in enable inputmethod.'); }).catch((err: BusinessErro...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { inputMethod } from '@kit.IMEKit';
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
let inputMethodController = inputMethod.getController();
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { let defaultIme = inputMethod.getDefaultInputMethod(); } catch(err) { console.error(`Failed to getDefaultInputMethod: ${JSON.stringify(err)}`); }
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { let inputMethodConfig = inputMethod.getSystemInputMethodConfigAbility(); } catch(err) { console.error(`Failed to get getSystemInputMethodConfigAbility: ${JSON.stringify(err)}`); }
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
let inputMethodSetting = inputMethod.getSetting();
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; let currentIme = inputMethod.getCurrentInputMethod(); try{ inputMethod.switchInputMethod(currentIme, (err: BusinessError, result: boolean) => { if (err) { console.error(`Failed to switchInputMethod: ${JSON.stringify(err)}`); return; } if ...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; let currentIme = inputMethod.getCurrentInputMethod(); try { inputMethod.switchInputMethod(currentIme).then((result: boolean) => { if (result) { console.info('Succeeded in switching inputmethod.'); } else { console.error('Failed to switchInput...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
let currentIme = inputMethod.getCurrentInputMethod();
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; try { let extra: Record<string, string> = {} inputMethod.switchCurrentInputMethodSubtype({ id: "ServiceExtAbility", label: "", name: "com.example.kikakeyboard", mode: "upper", locale: "", language: "", icon: "", iconId: 0, e...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; try { let extra: Record<string, string> = {} inputMethod.switchCurrentInputMethodSubtype({ id: "ServiceExtAbility", label: "", name: "com.example.kikakeyboard", mode: "upper", locale: "", language: "", icon: "", iconId: 0, e...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
let currentImeSubType = inputMethod.getCurrentInputMethodSubtype();
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; let currentIme = inputMethod.getCurrentInputMethod(); let imSubType = inputMethod.getCurrentInputMethodSubtype(); try { inputMethod.switchCurrentInputMethodAndSubtype(currentIme, imSubType, (err: BusinessError, result: boolean) => { if (err) { console....
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; let currentIme = inputMethod.getCurrentInputMethod(); let imSubType = inputMethod.getCurrentInputMethodSubtype(); try { inputMethod.switchCurrentInputMethodAndSubtype(currentIme, imSubType).then((result: boolean) => { if (result) { console.info('Succee...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
let inputMethodController = inputMethod.getInputMethodController();
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
let inputMethodSetting = inputMethod.getInputMethodSetting();
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; let inputMethodController = inputMethod.getController(); try { let messageHandler: inputMethod.MessageHandler = { onTerminated(): void { console.info('OnTerminated.'); }, onMessage(msgId: string, msgParam?:ArrayBuffer): void...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; let inputMethodController = inputMethod.getController(); try { let messageHandler: inputMethod.MessageHandler = { onTerminated(): void { console.info('OnTerminated.'); }, onMessage(msgId: string, msgParam?:ArrayBuffer): void...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; try { let textConfig: inputMethod.TextConfig = { inputAttribute: { textInputType: 0, enterKeyType: 1 } }; inputMethodController.attach(true, textConfig, (err: BusinessError) => { if (err) { console.error(`Failed to attach: ${JSO...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; try { let textConfig: inputMethod.TextConfig = { inputAttribute: { textInputType: 0, enterKeyType: 1 } }; inputMethodController.attach(true, textConfig).then(() => { console.info('Succeeded in attaching inputMethod.'); }).catch((err...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; try { let textConfig: inputMethod.TextConfig = { inputAttribute: { textInputType: 0, enterKeyType: 1 } }; let requestKeyboardReason: inputMethod.RequestKeyboardReason = inputMethod.RequestKeyboardReason.MOUSE; inputMethodController.at...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; import { inputMethod } from '@kit.IMEKit'; inputMethod.getController().discardTypingText().then(() => { console.info('Succeeded discardTypingText.'); }).catch((err: BusinessError) => { console.error(`Failed to discardTypingText errCode:${err.code}, errMsg:${er...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; inputMethodController.showTextInput((err: BusinessError) => { if (err) { console.error(`Failed to showTextInput: ${JSON.stringify(err)}`); return; } console.info('Succeeded in showing the inputMethod.'); });
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; inputMethodController.showTextInput().then(() => { console.info('Succeeded in showing text input.'); }).catch((err: BusinessError) => { console.error(`Failed to showTextInput: ${JSON.stringify(err)}`); });
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; let requestKeyboardReason = inputMethod.RequestKeyboardReason.MOUSE; inputMethodController.showTextInput(requestKeyboardReason).then(() => { console.info('Succeeded in showing text input.'); }).catch((err: BusinessError) => { console.error(`Failed to showText...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; inputMethodController.hideTextInput((err: BusinessError) => { if (err) { console.error(`Failed to hideTextInput: ${JSON.stringify(err)}`); return; } console.info('Succeeded in hiding text input.'); });
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; inputMethodController.hideTextInput().then(() => { console.info('Succeeded in hiding inputMethod.'); }).catch((err: BusinessError) => { console.error(`Failed to hideTextInput: ${JSON.stringify(err)}`); })
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; inputMethodController.detach((err: BusinessError) => { if (err) { console.error(`Failed to detach: ${JSON.stringify(err)}`); return; } console.info('Succeeded in detaching inputMethod.'); });
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; inputMethodController.detach().then(() => { console.info('Succeeded in detaching inputMethod.'); }).catch((err: BusinessError) => { console.error(`Failed to detach: ${JSON.stringify(err)}`); });
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; try { let windowId: number = 2000; inputMethodController.setCallingWindow(windowId, (err: BusinessError) => { if (err) { console.error(`Failed to setCallingWindow: ${JSON.stringify(err)}`); return; } console.info('Succeeded in setting c...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; try { let windowId: number = 2000; inputMethodController.setCallingWindow(windowId).then(() => { console.info('Succeeded in setting callingWindow.'); }).catch((err: BusinessError) => { console.error(`Failed to setCallingWindow: ${JSON.stringify(err)}...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; try { let cursorInfo: inputMethod.CursorInfo = { left: 0, top: 0, width: 600, height: 800 }; inputMethodController.updateCursor(cursorInfo, (err: BusinessError) => { if (err) { console.error(`Failed to updateCursor: ${JSON.stringify(err)}`); re...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; try { let cursorInfo: inputMethod.CursorInfo = { left: 0, top: 0, width: 600, height: 800 }; inputMethodController.updateCursor(cursorInfo).then(() => { console.info('Succeeded in updating cursorInfo.'); }).catch((err: BusinessError) => { console.err...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; try { inputMethodController.changeSelection('text', 0, 5, (err: BusinessError) => { if (err) { console.error(`Failed to changeSelection: ${JSON.stringify(err)}`); return; } console.info('Succeeded in changing selection.'); }); } catch(e...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; try { inputMethodController.changeSelection('test', 0, 5).then(() => { console.info('Succeeded in changing selection.'); }).catch((err: BusinessError) => { console.error(`Failed to changeSelection: ${JSON.stringify(err)}`); }) } catch(err) { consol...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; try { let inputAttribute: inputMethod.InputAttribute = { textInputType: 0, enterKeyType: 1 }; inputMethodController.updateAttribute(inputAttribute, (err: BusinessError) => { if (err) { console.error(`Failed to updateAttribute: ${JSON.stringify(err)}`...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; try { let inputAttribute: inputMethod.InputAttribute = { textInputType: 0, enterKeyType: 1 }; inputMethodController.updateAttribute(inputAttribute).then(() => { console.info('Succeeded in updating attribute.'); }).catch((err: BusinessError) => { cons...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; try { inputMethodController.stopInputSession((err: BusinessError, result: boolean) => { if (err) { console.error(`Failed to stopInputSession: ${JSON.stringify(err)}`); return; } if (result) { console.info('Succeeded in stopping inpu...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; try { inputMethodController.stopInputSession().then((result: boolean) => { if (result) { console.info('Succeeded in stopping inputSession.'); } else { console.error('Failed to stopInputSession.'); } }).catch((err: BusinessError) => { ...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; inputMethodController.showSoftKeyboard((err: BusinessError) => { if (!err) { console.info('Succeeded in showing softKeyboard.'); } else { console.error(`Failed to show softKeyboard: ${JSON.stringify(err)}`); } })
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; inputMethodController.showSoftKeyboard().then(() => { console.info('Succeeded in showing softKeyboard.'); }).catch((err: BusinessError) => { console.error(`Failed to show softKeyboard: ${JSON.stringify(err)}`); });
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; inputMethodController.hideSoftKeyboard((err: BusinessError) => { if (!err) { console.info('Succeeded in hiding softKeyboard.'); } else { console.error(`Failed to hide softKeyboard: ${JSON.stringify(err)}`); } })
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; inputMethodController.hideSoftKeyboard().then(() => { console.info('Succeeded in hiding softKeyboard.'); }).catch((err: BusinessError) => { console.error(`Failed to hide softKeyboard: ${JSON.stringify(err)}`); });
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; let msgId: string = "testMsgId"; let msgParam: ArrayBuffer = new ArrayBuffer(128); inputMethodController.sendMessage(msgId, msgParam).then(() => { console.info('Succeeded send message.'); }).catch((err: BusinessError) => { console.error(`Failed to send message...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; let messageHandler: inputMethod.MessageHandler = { onTerminated(): void { console.info('OnTerminated.'); }, onMessage(msgId: string, msgParam?:ArrayBuffer): void { console.info('recv message.'); } } inputMethodController.recvMessage(...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; inputMethodController.stopInput((err: BusinessError, result: boolean) => { if (err) { console.error(`Failed to stopInput: ${JSON.stringify(err)}`); return; } if (result) { console.info('Succeeded in stopping input.'); } else { console.error...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; inputMethodController.stopInput().then((result: boolean) => { if (result) { console.info('Succeeded in stopping input.'); } else { console.error('Failed to stopInput.'); } }).catch((err: BusinessError) => { console.error(`Failed to stopInput: ${JSO...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
function callback1(text: string) { console.info('Succeeded in getting callback1 data: ' + JSON.stringify(text)); } function callback2(text: string) { console.info('Succeeded in getting callback2 data: ' + JSON.stringify(text)); } try { inputMethodController.on('insertText', callback1); inputMethodController.o...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
let onInsertTextCallback = (text: string) => { console.info(`Succeeded in subscribing insertText: ${text}`); }; inputMethodController.off('insertText', onInsertTextCallback); inputMethodController.off('insertText');
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { inputMethodController.on('deleteLeft', (length: number) => { console.info(`Succeeded in subscribing deleteLeft, length: ${length}`); }); } catch(err) { console.error(`Failed to subscribe deleteLeft: ${JSON.stringify(err)}`); }
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
let onDeleteLeftCallback = (length: number) => { console.info(`Succeeded in subscribing deleteLeft, length: ${length}`); }; inputMethodController.off('deleteLeft', onDeleteLeftCallback); inputMethodController.off('deleteLeft');
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { inputMethodController.on('deleteRight', (length: number) => { console.info(`Succeeded in subscribing deleteRight, length: ${length}`); }); } catch(err) { console.error(`Failed to subscribe deleteRight: ${JSON.stringify(err)}`); }
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
let onDeleteRightCallback = (length: number) => { console.info(`Succeeded in subscribing deleteRight, length: ${length}`); }; inputMethodController.off('deleteRight', onDeleteRightCallback); inputMethodController.off('deleteRight');
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { inputMethodController.on('sendKeyboardStatus', (keyboardStatus: inputMethod.KeyboardStatus) => { console.info(`Succeeded in subscribing sendKeyboardStatus, keyboardStatus: ${keyboardStatus}`); }); } catch(err) { console.error(`Failed to subscribe sendKeyboardStatus: ${JSON.stringify(err)}`); }
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
let onSendKeyboardStatus = (keyboardStatus: inputMethod.KeyboardStatus) => { console.info(`Succeeded in subscribing sendKeyboardStatus, keyboardStatus: ${keyboardStatus}`); }; inputMethodController.off('sendKeyboardStatus', onSendKeyboardStatus); inputMethodController.off('sendKeyboardStatus');
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { inputMethodController.on('sendFunctionKey', (functionKey: inputMethod.FunctionKey) => { console.info(`Succeeded in subscribing sendFunctionKey, functionKey.enterKeyType: ${functionKey.enterKeyType}`); }); } catch(err) { console.error(`Failed to subscribe sendFunctionKey: ${JSON.stringify(err)}`); }
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
let onSendFunctionKey = (functionKey: inputMethod.FunctionKey) => { console.info(`Succeeded in subscribing sendFunctionKey, functionKey: ${functionKey.enterKeyType}`); }; inputMethodController.off('sendFunctionKey', onSendFunctionKey); inputMethodController.off('sendFunctionKey');
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { inputMethodController.on('moveCursor', (direction: inputMethod.Direction) => { console.info(`Succeeded in subscribing moveCursor, direction: ${direction}`); }); } catch(err) { console.error(`Failed to subscribe moveCursor: ${JSON.stringify(err)}`); }
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
let onMoveCursorCallback = (direction: inputMethod.Direction) => { console.info(`Succeeded in subscribing moveCursor, direction: ${direction}`); }; inputMethodController.off('moveCursor', onMoveCursorCallback); inputMethodController.off('moveCursor');
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { inputMethodController.on('handleExtendAction', (action: inputMethod.ExtendAction) => { console.info(`Succeeded in subscribing handleExtendAction, action: ${action}`); }); } catch(err) { console.error(`Failed to subscribe handleExtendAction: ${JSON.stringify(err)}`); }
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { let onHandleExtendActionCallback = (action: inputMethod.ExtendAction) => { console.info(`Succeeded in subscribing handleExtendAction, action: ${action}`); }; inputMethodController.off('handleExtendAction', onHandleExtendActionCallback); inputMethodController.off('handleExtendAction'); } catch(err) { ...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { inputMethodController.on('selectByRange', (range: inputMethod.Range) => { console.info(`Succeeded in subscribing selectByRange: start: ${range.start} , end: ${range.end}`); }); } catch(err) { console.error(`Failed to subscribe selectByRange: ${JSON.stringify(err)}`); }
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { let onSelectByRangeCallback = (range: inputMethod.Range) => { console.info(`Succeeded in subscribing selectByRange, start: ${range.start} , end: ${range.end}`); }; inputMethodController.off('selectByRange', onSelectByRangeCallback); inputMethodController.off('selectByRange'); } catch(err) { console....
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { inputMethodController.on('selectByMovement', (movement: inputMethod.Movement) => { console.info('Succeeded in subscribing selectByMovement: direction: ' + movement.direction); }); } catch(err) { console.error(`Failed to subscribe selectByMovement: ${JSON.stringify(err)}`); }
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { let onSelectByMovementCallback = (movement: inputMethod.Movement) => { console.info(`Succeeded in subscribing selectByMovement, movement.direction: ${movement.direction}`); }; inputMethodController.off('selectByMovement', onSelectByMovementCallback); inputMethodController.off('selectByMovement'); } ca...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { inputMethodController.on('getLeftTextOfCursor', (length: number) => { console.info(`Succeeded in subscribing getLeftTextOfCursor, length: ${length}`); let text:string = ""; return text; }); } catch(err) { console.error(`Failed to unsubscribing getLeftTextOfCursor. err: ${JSON.stringify(err)}`); ...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { let getLeftTextOfCursorCallback = (length: number) => { console.info(`Succeeded in unsubscribing getLeftTextOfCursor, length: ${length}`); let text:string = ""; return text; }; inputMethodController.off('getLeftTextOfCursor', getLeftTextOfCursorCallback); inputMethodController.off('getLeftText...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { inputMethodController.on('getRightTextOfCursor', (length: number) => { console.info(`Succeeded in subscribing getRightTextOfCursor, length: ${length}`); let text:string = ""; return text; }); } catch(err) { console.error(`Failed to subscribe getRightTextOfCursor. err: ${JSON.stringify(err)}`); }
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { let getRightTextOfCursorCallback = (length: number) => { console.info(`Succeeded in unsubscribing getRightTextOfCursor, length: ${length}`); let text:string = ""; return text; }; inputMethodController.off('getRightTextOfCursor', getRightTextOfCursorCallback); inputMethodController.off('getRigh...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { inputMethodController.on('getTextIndexAtCursor', () => { console.info(`Succeeded in subscribing getTextIndexAtCursor.`); let index:number = 0; return index; }); } catch(err) { console.error(`Failed to subscribe getTextIndexAtCursor. err: ${JSON.stringify(err)}`); }
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
try { let getTextIndexAtCursorCallback = () => { console.info(`Succeeded in unsubscribing getTextIndexAtCursor.`); let index:number = 0; return index; }; inputMethodController.off('getTextIndexAtCursor', getTextIndexAtCursorCallback); inputMethodController.off('getTextIndexAtCursor'); } catch(err) {...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
let setPreviewTextCallback1: inputMethod.SetPreviewTextCallback = (text: string, range: inputMethod.Range) => { console.info(`SetPreviewTextCallback1: Received text - ${text}, Received range - start: ${range.start}, end: ${range.end}`); }; let setPreviewTextCallback2: inputMethod.SetPreviewTextCallback = (text: stri...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
let setPreviewTextCallback1: inputMethod.SetPreviewTextCallback = (text: string, range: inputMethod.Range) => { console.info(`SetPreviewTextCallback1: Received text - ${text}, Received range - start: ${range.start}, end: ${range.end}`); }; let setPreviewTextCallback2: inputMethod.SetPreviewTextCallback = (text: stri...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
let finishTextPreviewCallback1 = () => { console.info(`FinishTextPreviewCallback1: finishTextPreview event triggered`); }; let finishTextPreviewCallback2 = () => { console.info(`FinishTextPreviewCallback2: finishTextPreview event triggered`); }; try { inputMethodController.on('finishTextPreview', finishTextPrevi...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
let finishTextPreviewCallback1 = () => { console.info(`FinishTextPreviewCallback1: finishTextPreview event triggered`); }; let finishTextPreviewCallback2 = () => { console.info(`FinishTextPreviewCallback2: finishTextPreview event triggered`); }; try { inputMethodController.on('finishTextPreview', finishTextPrevi...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { InputMethodSubtype } from '@kit.IMEKit'; try { inputMethodSetting.on('imeChange', (inputMethodProperty: inputMethod.InputMethodProperty, inputMethodSubtype: InputMethodSubtype) => { console.info('Succeeded in subscribing imeChange: inputMethodProperty: ' + JSON.stringify(inputMethodProperty) + " , inputM...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
inputMethodSetting.off('imeChange');
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { InputMethodSubtype } from '@kit.IMEKit'; import { BusinessError } from '@kit.BasicServicesKit'; let inputMethodProperty: inputMethod.InputMethodProperty = { name: 'com.example.kikakeyboard', id: 'propertyId', packageName: 'com.example.kikakeyboard', methodId: 'propertyId', } let inputMethodSetting = i...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { InputMethodSubtype } from '@kit.IMEKit'; import { BusinessError } from '@kit.BasicServicesKit'; let inputMethodProperty: inputMethod.InputMethodProperty = { name: 'com.example.kikakeyboard', id: 'propertyId', packageName: 'com.example.kikakeyboard', methodId: 'propertyId', } let inputMethodSetting = i...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { InputMethodSubtype } from '@kit.IMEKit'; import { BusinessError } from '@kit.BasicServicesKit'; let inputMethodSetting = inputMethod.getSetting(); try { inputMethodSetting.listCurrentInputMethodSubtype((err: BusinessError, data: Array<InputMethodSubtype>) => { if (err) { console.error(`Failed to l...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { InputMethodSubtype } from '@kit.IMEKit'; import { BusinessError } from '@kit.BasicServicesKit'; let inputMethodSetting = inputMethod.getSetting(); try { inputMethodSetting.listCurrentInputMethodSubtype().then((data: Array<InputMethodSubtype>) => { console.info('Succeeded in listing currentInputMethodSub...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; try { inputMethodSetting.getInputMethods(true, (err: BusinessError, data: Array<inputMethod.InputMethodProperty>) => { if (err) { console.error(`Failed to getInputMethods: ${JSON.stringify(err)}`); return; } console.info('Succeeded in get...
application-dev\reference\apis-ime-kit\js-apis-inputmethod.md
import { BusinessError } from '@kit.BasicServicesKit'; try { inputMethodSetting.getInputMethods(true).then((data: Array<inputMethod.InputMethodProperty>) => { console.info('Succeeded in getting inputMethods.'); }).catch((err: BusinessError) => { console.error(`Failed to getInputMethods: ${JSON.stringify(er...