1#  multimodalinput子系统ChangeLog
2
3##  cl.multimodalinput.1  inputMonitor接口实现错误修正
4
5多模输入inputMonitor接口中针对TouchEvent的监听接口,callback中TouchEvent原先引用arkui-js的通用事件TouchEvent,但该接口没有对外暴露(即未export),IDE中默认TouchEvent为arkui-ts中的TouchEvent,ArtTS语法整改之后,原接口失效。因此需要将inputMointor中的TouchEvent引用修改为多模输入的TouchEvent。
6
7**变更影响**
8
9字段名变更,原有的字段获取的值为undefine
10
11**关键的接口/组件变更**
12
13使用inputMonitor监听多模输入TouchEvent时,需要单独import多模的touchEvent类
14
15```ts
16import touchEvent from '@ohos.multimodalInput.touchEvent';
17try {
18  inputMonitor.on('touch', (touchEvent: touchEvent.TouchEvent) => {
19    console.log(`Monitor on success ${JSON.stringify(touchEvent)}`);
20    return false;
21  });
22} catch (error) {
23  console.log(`Monitor on failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
24}
25```
26
27**适配指导**
28
29OpenHarmony4.0.11.5之后需要应用将字段修改为多模的TouchEvent字段名
30
31| 变更前         | 变更后     |
32| -------------- | ---------- |
33| type           | action     |
34| timestamp      | actionTime |
35| deviceId       | deviceId   |
36| globalX        | screenX    |
37| globalY        | screenY    |
38| localX         | windowX    |
39| localY         | windowY    |
40| force          | pressure   |
41| touches        | touches    |
42| changedTouches | touches    |