1# @ohos.multimodalInput.touchEvent (Touch Event) 2 3The **touchEvent** module provides touchscreen events reported by a device. It is inherited from [InputEvent](./js-apis-inputevent.md). 4 5> **NOTE** 6> 7> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8 9## Modules to Import 10 11```js 12import { Action,ToolType,SourceType,Touch,TouchEvent } from '@kit.InputKit'; 13``` 14 15## Action 16 17Enumerates touch event types. 18 19**System capability**: SystemCapability.MultimodalInput.Input.Core 20 21| Name | Value | Description | 22| ------ | ------ | ---- | 23| CANCEL | 0 | Cancellation of touch.| 24| DOWN | 1 | Pressing of touch.| 25| MOVE | 2 | Moving of touch.| 26| UP | 3 | Lifting of touch.| 27 28## ToolType 29 30Enumerates touch tool types. 31 32**System capability**: SystemCapability.MultimodalInput.Input.Core 33 34| Name | Value | Description | 35| -------- | ------ | ---- | 36| FINGER | 0 | Finger. | 37| PEN | 1 | Stylus. | 38| RUBBER | 2 | Eraser. | 39| BRUSH | 3 | Brush. | 40| PENCIL | 4 | Pencil. | 41| AIRBRUSH | 5 | Air brush. | 42| MOUSE | 6 | Mouse. | 43| LENS | 7 | Lens. | 44 45## SourceType 46 47Enumerates touch source types. 48 49**System capability**: SystemCapability.MultimodalInput.Input.Core 50 51| Name | Value | Description | 52| ------------ | ------ | ---- | 53| TOUCH_SCREEN | 0 | Touchscreen. | 54| PEN | 1 | Stylus. | 55| TOUCH_PAD | 2 | Touchpad. | 56 57<!--Del--> 58## FixedMode<sup>19+</sup> 59 60Enumerates coordinate correction modes. This API takes effect only for mobile phones. 61 62**System capability**: SystemCapability.MultimodalInput.Input.Core 63 64| Name | Value | Description | 65| ------------ | ------ | ---- | 66| NONE | 0 | Normal mode.| 67| AUTO | 1 | One-handed mode.| 68<!--DelEnd--> 69 70## Touch 71 72Defines the touch point information. 73 74**System capability**: SystemCapability.MultimodalInput.Input.Core 75 76| Name | Type | Readable | Writable | Description | 77| ----------- | ------ | ---- | ---- | ----------------------------------- | 78| id | number | Yes | No | Touch event ID. | 79| pressedTime | number | Yes | No | Press timestamp, in μs. | 80| screenX | number | Yes | No | X coordinate of the touch position on the screen. | 81| screenY | number | Yes | No | Y coordinate of the touch position on the screen. | 82| windowX | number | Yes | No | X coordinate of the touch position in the window. | 83| windowY | number | Yes | No | Y coordinate of the touch position in the window. | 84| pressure | number | Yes | No | Pressure value. The value range is [0.0, 1.0]. The value **0.0** indicates that the pressure is not supported. | 85| width | number | Yes | No | Width of the touch area. | 86| height | number | Yes | No | Height of the touch area. | 87| tiltX | number | Yes | No | Angle relative to the YZ plane. The value range is [-90, 90]. A positive value indicates a rightward tilt.| 88| tiltY | number | Yes | No | Angle relative to the XZ plane. The value range is [-90, 90]. A positive value indicates a downward tilt.| 89| toolX | number | Yes | No | X coordinate of the center point of the tool area. | 90| toolY | number | Yes | No | Y coordinate of the center point of the tool area. | 91| toolWidth | number | Yes | No | Width of the tool area. | 92| toolHeight | number | Yes | No | Height of the tool area. | 93| rawX | number | Yes | No | X coordinate of the input device. | 94| rawY | number | Yes | No | Y coordinate of the input device. | 95| toolType | [ToolType](#tooltype) | Yes | No | Tool type. | 96| <!--DelRow-->fixedDisplayX<sup>19+</sup>| number| Yes | No | **screenX** correction value in one-hand mode.<br> **NOTE**: This API takes effect only for mobile phones.| 97| <!--DelRow-->fixedDisplayY<sup>19+</sup>| number| Yes | No | **screenY** correction value in one-hand mode.<br> This API takes effect only for mobile phones. | 98 99## TouchEvent 100 101Defines a touch event. 102 103**System capability**: SystemCapability.MultimodalInput.Input.Core 104 105| Name | Type | Readable | Writable | Description | 106| ---------- | ---------- | ---- | ---- | --------- | 107| action | [Action](#action) | Yes | No | Touch event type. | 108| touch | [Touch](#touch) | Yes | No | Current touch point. | 109| touches | [Touch](#touch)[] | Yes | No | All touch points. | 110| sourceType | [SourceType](#sourcetype) | Yes | No | Enumerates touch source types.| 111| <!--DelRow-->fixedMode<sup>19+</sup> | [FixedMode](#fixedmode19) | Yes | Yes | Coordinate correction mode.<br> This API takes effect only for mobile phones.| 112