1# 输入法框架子系统-输入法框架ChangeLog 2 3## cl.imf.1 @ohos.InputMethod中on('imeShow')系统接口权限校验失败返回错误码变更 4 5**变更影响** 6 7使用on('imeShow')接口,系统权限校验失败的返回码从201变更为202。 8 9## cl.imf.2 @ohos.InputMethod中on('imeHide')系统接口权限校验失败返回错误码变更 10 11**变更影响** 12 13使用on('imeHide')接口,系统权限校验失败的返回码从201变更为202。 14 15## cl.imf.3 @ohos.InputMethod中off接口新增参数 16 17off接口新增需要取消订阅的回调函数作为可选参数,需要与on接口传入的保持一致。 18 19| 接口 | 变更前 | 变更后 | 20| ------------------------- | ------------------------------------- | ------------------------------------------------------------ | 21| off('insertText') | off(type: 'insertText'): void | off(type: 'insertText', callback?: (text: string) => void): void | 22| off('deleteLeft') | off(type: 'deleteLeft'): void | off(type: 'deleteLeft', callback?: (length: number) => void): void | 23| off('deleteRight') | off(type: 'deleteRight'): void | off(type: 'deleteRight', callback?: (length: number) => void): void | 24| off('sendKeyboardStatus') | off(type: 'sendKeyboardStatus'): void | off(type: 'sendKeyboardStatus', callback?: (keyboardStatus: KeyboardStatus) => void): void | 25| off('sendFunctionKey') | off(type: 'sendFunctionKey'): void | off(type: 'sendFunctionKey', callback?: (functionKey: FunctionKey) => void): void | 26| off('moveCursor') | off(type: 'moveCursor'): void | off(type: 'moveCursor', callback?: (direction: Direction) => void): void | 27| off('handleExtendAction') | off(type: 'handleExtendAction'): void | off(type: 'handleExtendAction', callback?: (action: ExtendAction) => void): void | 28| off('selectByRange') | off(type: 'selectByRange'): void | off(type: 'selectByRange', callback?: Callback\<Range\>): void | 29| off('selectByMovement') | off(type: 'selectByMovement'): void | off(type: 'selectByMovement', callback?: Callback\<Movement\>): void | 30 31**变更影响** 32 33以上接口的调用,有多个订阅回调时,可传入订阅回调函数只取消单个回调函数的订阅,当该参数不填写时,取消订阅对应的所有回调事件。 34 35**适配指导** 36 37请参考接口说明:[@ohos.inputMethod.d.ts](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md) 38