mmi-api-setCustomCursor_api-Improve

Signed-off-by:xixian_2023<xixian@huawei.com>
This commit is contained in:
xixian_2023 2023-12-05 16:07:19 +08:00
parent 5b5e1bcb27
commit 71968609cb
2 changed files with 60 additions and 0 deletions

View File

@ -110,6 +110,38 @@ declare namespace inputEventClient {
touchEvent: TouchEvent;
}
/**
* Defines event of key that user want to inject.
*
* @interface KeyEventData
* @syscap SystemCapability.MultimodalInput.Input.InputSimulator
* @systemapi hide for inner use
* @since 11
*/
interface KeyEventData {
/**
* Inject key event.
*
* @type { KeyEvent }
* @syscap SystemCapability.MultimodalInput.Input.InputSimulator
* @systemapi hide for inner use
* @since 11
*/
keyEvent: KeyEvent;
}
/**
* Inject system keys.
*
* @param { KeyEventData } keyEvent - the key event to be injected.
* @throws { BusinessError } 202 - SystemAPI permission error.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.MultimodalInput.Input.InputSimulator
* @systemapi hide for inner use
* @since 11
*/
function injectKeyEvent(keyEvent: KeyEventData): void;
/**
* Inject system keys.
*

View File

@ -14,6 +14,7 @@
*/
import type { AsyncCallback } from './@ohos.base';
import type image from './@ohos.multimedia.image';
/**
* Declares interfaces related to mouse pointer attributes.
@ -1286,6 +1287,33 @@ declare namespace pointer {
* @since 10
*/
function getTouchpadRightClickType(): Promise<RightClickType>;
/**
* Sets the custom cursor.
*
* @param { number } windowId - Window ID.
* @param { image.PixelMap } pixelMap - the cursor of pixelMap.
* @param { number } focusX - focus x.
* @param { number } focusY - focus y.
* @returns { Promise<void> } Returns the result through a promise.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.MultimodalInput.Input.Pointer
* @since 11
*/
function setCustomCursor(windowId: number, pixelMap: image.PixelMap, focusX?: number, focusY?: number): Promise<void>;
/**
* Sets the custom cursor through sync mode.
*
* @param { number } windowId - Window ID.
* @param { image.PixelMap } pixelMap - the cursor of pixelMap.
* @param { number } focusX - focus x.
* @param { number } focusY - focus y.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.MultimodalInput.Input.Pointer
* @since 11
*/
function setCustomCursorSync(windowId: number, pixelMap: image.PixelMap, focusX?: number, focusY?: number): void;
}
export default pointer;