Description:内滑手势SDK

Feature or Bugfix:Feature
Binary Source:No
PrivateCode(Yes/No):No

Signed-off-by: f30059641 <fengchangqing2@huawei.com>
This commit is contained in:
f30059641 2024-07-31 17:29:55 +08:00 committed by 冯长青
parent ac280b8b51
commit f3c18e457c
3 changed files with 71 additions and 3 deletions

View File

@ -136,6 +136,43 @@ export declare interface FourFingersSwipe {
y: number;
}
/**
* Swipe Inward event on touchPad
*
* @interface SwipeInward
* @syscap SystemCapability.MultimodalInput.Input.Core
* @systemapi hide for inner use
* @since 12
*/
export declare interface SwipeInward {
/**
* Action type
* @type { ActionType }
* @syscap SystemCapability.MultimodalInput.Input.Core
* @systemapi hide for inner use
* @since 12
*/
type: ActionType;
/**
* Coordinate x
* @type { number }
* @syscap SystemCapability.MultimodalInput.Input.Core
* @systemapi hide for inner use
* @since 12
*/
x: number;
/**
* Coordinate y
* @type { number }
* @syscap SystemCapability.MultimodalInput.Input.Core
* @systemapi hide for inner use
* @since 12
*/
y: number;
}
/**
* Three fingers tap event on touchPad
*

View File

@ -22,7 +22,7 @@ import { Callback } from './@ohos.base';
import { MouseEvent } from './@ohos.multimodalInput.mouseEvent';
import type display from './@ohos.display';
import type { TouchEvent } from './@ohos.multimodalInput.touchEvent';
import type { Rotate, Pinch, ThreeFingersSwipe, FourFingersSwipe } from './@ohos.multimodalInput.gestureEvent';
import type { Rotate, Pinch, ThreeFingersSwipe, FourFingersSwipe, SwipeInward } from './@ohos.multimodalInput.gestureEvent';
import type { ThreeFingersTap } from './@ohos.multimodalInput.gestureEvent';
import type { FingerprintEvent } from './@ohos.multimodalInput.shortKey';
@ -360,5 +360,35 @@ declare namespace inputMonitor {
* @since 12
*/
function off(type: 'fingerprint', receiver?: Callback<FingerprintEvent>): void;
/**
* Enables listening touchPad swipe inward events.
*
* @permission ohos.permission.INPUT_MONITORING
* @param { 'swipeInward' } type - Event type, which is **swipeInward**.
* @param { Callback<SwipeInward> } receiver - Callback used to receive the reported data.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - SystemAPI permit error.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.MultimodalInput.Input.InputMonitor
* @systemapi hide for inner use
* @since 12
*/
function on(type: 'swipeInward', receiver: Callback<SwipeInward>): void;
/**
* Cancel listening touchPad swipe inward events.
*
* @permission ohos.permission.INPUT_MONITORING
* @param { 'swipeInward' } type - Event type, which is **swipeInward**.
* @param { Callback<SwipeInward> } receiver - Callback used to receive the reported data.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - SystemAPI permit error.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.MultimodalInput.Input.InputMonitor
* @systemapi hide for inner use
* @since 12
*/
function off(type: 'swipeInward', receiver?: Callback<SwipeInward>): void;
}
export default inputMonitor;

View File

@ -19,7 +19,7 @@
*/
import {
ActionType, FourFingersSwipe, Pinch, Rotate, ThreeFingersSwipe, ThreeFingersTap
ActionType, FourFingersSwipe, Pinch, Rotate, ThreeFingersSwipe, ThreeFingersTap, SwipeInward
} from '@ohos.multimodalInput.gestureEvent';
import infraredEmitter from '@ohos.multimodalInput.infraredEmitter';
import inputConsumer from '@ohos.multimodalInput.inputConsumer';
@ -44,5 +44,6 @@ export {
Action, ActionType, Axis, AxisValue, Button, FourFingersSwipe, InputEvent, IntentionCode,
Key, KeyAction, KeyCode, KeyEvent, MouseAction, MouseEvent, MouseToolType, Pinch, Rotate,
SourceType, ThreeFingersSwipe, ThreeFingersTap, ToolType, Touch, TouchEvent, inputConsumer,
inputDevice, inputDeviceCooperate, inputEventClient, inputMonitor, pointer, shortKey, infraredEmitter
inputDevice, inputDeviceCooperate, inputEventClient, inputMonitor, pointer, shortKey, infraredEmitter,
SwipeInward
};