diff --git a/api/@ohos.multimodalInput.inputDeviceCooperate.d.ts b/api/@ohos.multimodalInput.inputDeviceCooperate.d.ts index b0ae78993a0a609754d534c0ed954861bf050619..58d7d7d70e0e3a69cf773fec0a8850d9605f8b7a 100644 --- a/api/@ohos.multimodalInput.inputDeviceCooperate.d.ts +++ b/api/@ohos.multimodalInput.inputDeviceCooperate.d.ts @@ -82,6 +82,56 @@ declare namespace inputDeviceCooperate { MSG_COOPERATE_STATE_OFF = 501, } + /** + * Represents the status of the mouse traversal switch. + * + * @interface TraversalSwitchStatus + * @syscap SystemCapability.MultimodalInput.Input.Cooperator + * @systemapi hide for inner use + * @since 20 + */ + interface TraversalSwitchStatus { + /** + * Indicates status of the mouse traversal switch. + * + * @type { boolean } + * @syscap SystemCapability.MultimodalInput.Input.Cooperator + * @systemapi hide for inner use + * @since 20 + */ + state: boolean; + } + + /** + * Represents the data received in the mouse traversal event callback. + * + * @interface CooperationCallbackData + * @syscap SystemCapability.MultimodalInput.Input.Cooperator + * @systemapi hide for inner use + * @since 20 + */ + interface CooperationCallbackData { + /** + * Descriptor of the device involved in the mouse traversal event. + * + * @type { string } + * @syscap SystemCapability.MultimodalInput.Input.Cooperator + * @systemapi hide for inner use + * @since 20 + */ + deviceDescriptor: string; + + /** + * Details of the cooperation event message. + * + * @type { EventMsg } + * @syscap SystemCapability.MultimodalInput.Input.Cooperator + * @systemapi hide for inner use + * @since 20 + */ + eventMsg: EventMsg; + } + /** * Enable or disable the mouse traversal. * @@ -259,7 +309,19 @@ declare namespace inputDeviceCooperate { * @systemapi hide for inner use * @since 12 */ - function getState(deviceDescriptor: string, callback: AsyncCallback<{ state: boolean }>): void; + /** + * Obtains the status of the mouse traversal switch. + * + * @param {string} deviceDescriptor Descriptor of the target network for mouse traversal. + * @param {AsyncCallback} callback Asynchronous callback used to receive the status of the mouse traversal switch. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.MultimodalInput.Input.Cooperator + * @systemapi hide for inner use + * @since 20 + */ + function getState(deviceDescriptor: string, callback: AsyncCallback): void; /** * Obtains the status of the mouse traversal switch. @@ -284,7 +346,19 @@ declare namespace inputDeviceCooperate { * @systemapi hide for inner use * @since 12 */ - function getState(deviceDescriptor: string): Promise<{ state: boolean }>; + /** + * Obtains the status of the mouse traversal switch. + * + * @param {string} deviceDescriptor Descriptor of the target network for mouse traversal. + * @returns { Promise } A promise used by returning state + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.MultimodalInput.Input.Cooperator + * @systemapi hide for inner use + * @since 20 + */ + function getState(deviceDescriptor: string): Promise; /** * Enables listening for mouse traversal events. @@ -309,7 +383,19 @@ declare namespace inputDeviceCooperate { * @systemapi hide for inner use * @since 12 */ - function on(type: 'cooperation', callback: AsyncCallback<{ deviceDescriptor: string, eventMsg: EventMsg }>): void; + /** + * Enables listening for mouse traversal events. + * + * @param { 'cooperation' } type Registration type. + * @param { AsyncCallback } callback Asynchronous callback used to receive mouse traversal events. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.MultimodalInput.Input.Cooperator + * @systemapi hide for inner use + * @since 20 + */ + function on(type: 'cooperation', callback: AsyncCallback): void; /** * Disables listening for mouse traversal events. diff --git a/api/@ohos.multimodalInput.inputEventClient.d.ts b/api/@ohos.multimodalInput.inputEventClient.d.ts index fc4b4d1811a0659e0d4c8891e30cf71b847b33ad..af61b31baeb5d19cae8f68f8dd190f2daea8ba54 100644 --- a/api/@ohos.multimodalInput.inputEventClient.d.ts +++ b/api/@ohos.multimodalInput.inputEventClient.d.ts @@ -135,6 +135,26 @@ declare namespace inputEventClient { keyEvent: KeyEvent; } + /** + * Defines info of key that user want to inject. + * + * @interface KeyEventInfo + * @syscap SystemCapability.MultimodalInput.Input.InputSimulator + * @systemapi hide for inner use + * @since 20 + */ + interface KeyEventInfo { + /** + * Inject key event. + * + * @type { KeyEvent } + * @syscap SystemCapability.MultimodalInput.Input.InputSimulator + * @systemapi hide for inner use + * @since 20 + */ + KeyEvent: KeyEvent; + } + /** * Inject system keys. * @@ -184,7 +204,20 @@ declare namespace inputEventClient { * @systemapi hide for inner use * @since 12 */ - function injectEvent({ KeyEvent: KeyEvent }): void; + /** + * Inject system keys. + * + * @permission ohos.permission.INJECT_INPUT_EVENT + * @param { KeyEventInfo } KeyEvent - the key event to be injected. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.MultimodalInput.Input.InputSimulator + * @systemapi hide for inner use + * @since 20 + */ + function injectEvent( KeyEvent: KeyEventInfo ): void; /** * Inject mouse event.