添加注入权限

Signed-off-by: renxinyao <renxinyao2@huawei.com>
This commit is contained in:
renxinyao 2024-07-18 16:24:43 +08:00
parent 388e8ddacc
commit 5258943aec

View File

@ -146,6 +146,19 @@ declare namespace inputEventClient {
* @systemapi hide for inner use
* @since 11
*/
/**
* Inject system keys.
*
* @permission ohos.permission.INJECT_INPUT_EVENT
* @param { KeyEventData } keyEvent - the key event to be injected.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - SystemAPI permission error.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* <br>2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.MultimodalInput.Input.InputSimulator
* @systemapi hide for inner use
* @since 12
*/
function injectKeyEvent(keyEvent: KeyEventData): void;
/**
@ -158,6 +171,18 @@ declare namespace inputEventClient {
* @systemapi hide for inner use
* @since 8
*/
/**
* Inject system keys.
*
* @permission ohos.permission.INJECT_INPUT_EVENT
* @param { { KeyEvent } } KeyEvent - the key event to be injected.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* <br>2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.MultimodalInput.Input.InputSimulator
* @systemapi hide for inner use
* @since 12
*/
function injectEvent({ KeyEvent: KeyEvent }): void;
/**
@ -171,6 +196,19 @@ declare namespace inputEventClient {
* @systemapi hide for inner use
* @since 11
*/
/**
* Inject mouse event.
*
* @permission ohos.permission.INJECT_INPUT_EVENT
* @param { MouseEventData } mouseEvent - the mouse event to be injected.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - SystemAPI permission error.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* <br>2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.MultimodalInput.Input.InputSimulator
* @systemapi hide for inner use
* @since 12
*/
function injectMouseEvent(mouseEvent: MouseEventData): void;
/**
@ -184,12 +222,27 @@ declare namespace inputEventClient {
* @systemapi hide for inner use
* @since 11
*/
/**
* Inject touch event.
*
* @permission ohos.permission.INJECT_INPUT_EVENT
* @param { TouchEventData } touchEvent - the touch event to be injected.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - SystemAPI permission error.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* <br>2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.MultimodalInput.Input.InputSimulator
* @systemapi hide for inner use
* @since 12
*/
function injectTouchEvent(touchEvent: TouchEventData): void;
/**
* Permit event injection permission.
*
* @permission ohos.permission.INJECT_INPUT_EVENT
* @param { boolean } result - Authorization result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - SystemAPI permission error.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* <br>2. Incorrect parameter types; 3. Parameter verification failed.