@ohos.multimodalInput.touchEvent (Touch Event) (System API)
The touchEvent module provides touch events reported by a device. It is inherited from InputEvent.
NOTE
The initial APIs of this module are supported since API version 19. Newly added APIs will be marked with a superscript to indicate their earliest API version.
This topic describes only the system APIs provided by the module. For details about its public APIs, see @ohos.multimodalInput.touchEvent (Touch Event).
Modules to Import
import { FixedMode, Touch, TouchEvent } from '@kit.InputKit';
FixedMode
Enumerates coordinate correction modes.
System capability: SystemCapability.MultimodalInput.Input.Core
System API: This is a system API.
| Name | Value | Description |
|---|---|---|
| NONE | 0 | Normal mode. |
| AUTO | 1 | One-handed mode. |
Touch
Defines the touch point information.
System capability: SystemCapability.MultimodalInput.Input.Core
System API: This is a system API.
| Name | Type | Read-Only | Optional | Description |
|---|---|---|---|---|
| fixedDisplayX | number | No | Yes | screenX correction value in one-handed mode. |
| fixedDisplayY | number | No | Yes | screenY correction value in one-handed mode. |
| blobId24+ | number | No | Yes | Touch point attribute ID. Currently, only single-finger touch is supported. The value 1 indicates left-hand touch, and the value 2 indicates right-hand touch. |
TouchEvent
Defines a touch event.
System capability: SystemCapability.MultimodalInput.Input.Core
System API: This is a system API.
| Name | Type | Read-Only | Optional | Description |
|---|---|---|---|---|
| fixedMode | FixedMode | No | Yes | Coordinate correction mode. |
| isInject20+ | boolean | No | Yes | Whether the touch event is an injection event. For details about injection events, see @ohos.multimodalInput.inputEventClient. |
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 capi-input-input-cursorinfo
openharmony 鸿蒙 js-apis-inputevent
openharmony 鸿蒙 js-apis-infraredemitter
openharmony 鸿蒙 js-apis-inputeventclient-sys
openharmony 鸿蒙 capi-input-input-keystate
openharmony 鸿蒙 js-apis-keycode
openharmony 鸿蒙 capi-input-input-axisevent
openharmony 鸿蒙 js-apis-pointer-sys