• Home
Name
Date
Size
#Lines
LOC

..--

etc/12-May-2024-2,8852,833

examples/12-May-2024-253200

figures/12-May-2024-

frameworks/12-May-2024-26,40021,630

interfaces/native/innerkits/12-May-2024-6,9191,392

libudev/12-May-2024-1,9471,462

patch/12-May-2024-322,983224,224

sa_profile/12-May-2024-3329

service/12-May-2024-31,45325,188

test/12-May-2024-7,0704,727

tools/12-May-2024-12,5959,507

uinput/12-May-2024-862564

util/12-May-2024-6,5574,867

.gitattributesD12-May-2024631 1615

BUILD.gnD12-May-20244.1 KiB158139

CODEOWNERS.hD12-May-2024737 1514

LICENSED12-May-20249.9 KiB177150

OAT.xmlD12-May-20241.1 KiB3011

README.mdD12-May-20244.8 KiB9669

README_zh.mdD12-May-20244.4 KiB9669

bundle.jsonD12-May-20243.8 KiB131130

mmi_uinput.rcD12-May-2024818 2219

multimodalinput.cfgD12-May-20241.5 KiB4544

multimodalinput_mini.gniD12-May-202410.5 KiB296264

README.md

1 # multimodalinput\_input<a name="EN-US_TOPIC_0000001147497185"></a>
2 
3 -   [Introduction](#section11660541593)
4 -   [Directory Structure](#section14408467105)
5 -   [Usage](#section18111235161011)
6     -   [Available APIs](#section86358081116)
7     -   [Usage Guidelines](#section789634518111)
8     -   [Equipment Capability Support](#section789634518112)
9 
10 -   [Repositories Involved](#section135327891219)
11 
12 ## Introduction<a name="section11660541593"></a>
13 
14 The module of this repository is applied on the basis of standard systems to provide devices with single-touch input capabilities. This module reports touch events to the JS UI framework or application framework, which then encapsulates the events and provides APIs for apps.
15 
16 ## Directory Structure<a name="section14408467105"></a>
17 
18 ```
19 /foundation/multimodalinput/input
20 ├── interfaces                   # External APIs
21 │   └── native                   # Native APIs
22 │       └── innerkits            # Native APIs provided for internal subsystems
23 ├── service                      # Service framework code
24 ├── sa_profile                   # Service startup configuration file
25 ├── uinput                       # Input event injection module
26 ```
27 
28 ## Usage<a name="section18111235161011"></a>
29 
30 ### Available APIs<a name="section86358081116"></a>
31 
32 Available APIs of Multimodal Input are event injection ones, which are open only to system apps currently.
33 
34 -   The  **inputEventClient**  class provides methods for processing injection events.
35 
36     **Table  1**  Major APIs in inputEventClient
37 
38     <a name="t49c6a8df29a143a98ef6f66f43c7eac8"></a>
39     <table><thead align="left"><tr id="rf815506c67654ad4ac014b339ee3292d"><th class="cellrowborder" valign="top" width="15.031503150315032%" id="mcps1.2.4.1.1"><p id="a59bc0498281e498289e11d5e584eb293"><a name="a59bc0498281e498289e11d5e584eb293"></a><a name="a59bc0498281e498289e11d5e584eb293"></a>Category</p>
40     </th>
41     <th class="cellrowborder" valign="top" width="23.152315231523154%" id="mcps1.2.4.1.2"><p id="aa1226795522e4609b6b1d210255beeff"><a name="aa1226795522e4609b6b1d210255beeff"></a><a name="aa1226795522e4609b6b1d210255beeff"></a>API</p>
42     </th>
43     <th class="cellrowborder" valign="top" width="61.816181618161814%" id="mcps1.2.4.1.3"><p id="a34777ce8d3174036ba45b9fd51dc4848"><a name="a34777ce8d3174036ba45b9fd51dc4848"></a><a name="a34777ce8d3174036ba45b9fd51dc4848"></a>Description</p>
44     </th>
45     </tr>
46     </thead>
47     <tbody><tr id="ra7599f41f04548858a77e2062aad2cf5"><td class="cellrowborder" valign="top" width="15.031503150315032%" headers="mcps1.2.4.1.1 "><p id="a63ab1186072d4bcdb32d4e11b9243b57"><a name="a63ab1186072d4bcdb32d4e11b9243b57"></a><a name="a63ab1186072d4bcdb32d4e11b9243b57"></a>Event injection</p>
48     </td>
49     <td class="cellrowborder" valign="top" width="23.152315231523154%" headers="mcps1.2.4.1.2 "><p id="a3d9b89df15074475a45ed26503e22c21"><a name="a3d9b89df15074475a45ed26503e22c21"></a><a name="a3d9b89df15074475a45ed26503e22c21"></a>function injectEvent({KeyEvent: KeyEvent}): void;</p>
50     </td>
51     <td class="cellrowborder" valign="top" width="61.816181618161814%" headers="mcps1.2.4.1.3 "><p id="a33c82952289f40a09773ce2fed14f6aa"><a name="a33c82952289f40a09773ce2fed14f6aa"></a><a name="a33c82952289f40a09773ce2fed14f6aa"></a>Injects events.</p>
52     </td>
53     </tr>
54     </tbody>
55     </table>
56 
57 
58 ### Usage Guidelines<a name="section789634518111"></a>
59 
60 Currently, only the  **BACK**  key event can be injected.
61 
62 When a system app needs to return to the previous directory, you can call the API to inject the  **BACK**  key event to Multimodal Input, which then transfers this event to the system app, thereby achieving the return effect. The example code is as follows:
63 
64 ```
65 // Import the required JavaScript API library.
66 import input from '@ohos.multimodalInput.inputEventClient'
67 
68 // Call the API for injecting events.
69 var keyEvent = {
70     isPressed:true,           // Action type of the key event. true indicates that the key is being pressed down, and false indicates that the key is being released.
71     code:2,                   // Keycode for the key, for example, 2 for the BACK key.
72     keyDownDuration:10,       // Duration in which the current key is pressed down before it is released, in milliseconds.
73 };
74 
75 var res = input.injectEvent({
76     KeyEvent: keyEvent
77 });
78 ```
79 
80 >![](figures/icon-note.gif) **NOTE:**
81 >The new APIs must be compatible with the original capabilities.
82 
83 ### Equipment Capability Support<a name="section789634518112"></a>
84 
85 |   device    | touch | touchpad | mouse | keyboard |
86 | :---------: | :---: | :------: | :---: | :------: |
87 |   rk3568    |   Y   |    Y     |   Y   |    Y     |
88 | hi3516dv300 |   Y   |    N     |   N   |    N     |
89 
90 ## Repositories Involved<a name="section135327891219"></a>
91 
92 Multimodal input subsystem
93 
94 **multimodalinput\_input**
95 
96 

README_zh.md

1 # 多模输入标准系统组件<a name="ZH-CN_TOPIC_0000001147497185"></a>
2 
3 -   [简介](#section11660541593)
4 -   [目录](#section14408467105)
5 -   [使用](#section18111235161011)
6     -   [接口说明](#section86358081116)
7     -   [使用说明](#section789634518111)
8     -   [设备能力支持](#section789634518112)
9 
10 -   [相关仓](#section135327891219)
11 
12 ## 简介<a name="section11660541593"></a>
13 
14 本组件应用于标准系统之上,为设备提供单指触控输入能力。本组件将触屏输入产生的事件上报到JS UI框架或用户程序框架,JS UI框架根据上报的事件再次封装,对应用提供接口。
15 
16 ## 目录<a name="section14408467105"></a>
17 
18 ```
19 /foundation/multimodalinput/input
20 ├── interfaces                   # 对外接口存放目录
21 │   └── native                   # 对外native层接口存放目录
22 │       └── innerkits            # 对系统内部子系统提供native层接口存放目录
23 ├── service                      # 服务框架代码
24 ├── sa_profile                   # 服务启动配置文件
25 ├── uinput                       # 输入事件注入模块
26 ```
27 
28 ## 使用<a name="section18111235161011"></a>
29 
30 ### 接口说明<a name="section86358081116"></a>
31 
32 多模输入目前提供的接口为事件注入接口,该接口目前仅对系统应用开放。
33 
34 -   inputEventClient是处理注入事件类。
35 
36     **表 1**  inputEventClient的主要接口
37 
38     <a name="t49c6a8df29a143a98ef6f66f43c7eac8"></a>
39     <table><thead align="left"><tr id="rf815506c67654ad4ac014b339ee3292d"><th class="cellrowborder" valign="top" width="15.031503150315032%" id="mcps1.2.4.1.1"><p id="a59bc0498281e498289e11d5e584eb293"><a name="a59bc0498281e498289e11d5e584eb293"></a><a name="a59bc0498281e498289e11d5e584eb293"></a>功能分类</p>
40     </th>
41     <th class="cellrowborder" valign="top" width="23.152315231523154%" id="mcps1.2.4.1.2"><p id="aa1226795522e4609b6b1d210255beeff"><a name="aa1226795522e4609b6b1d210255beeff"></a><a name="aa1226795522e4609b6b1d210255beeff"></a>接口名</p>
42     </th>
43     <th class="cellrowborder" valign="top" width="61.816181618161814%" id="mcps1.2.4.1.3"><p id="a34777ce8d3174036ba45b9fd51dc4848"><a name="a34777ce8d3174036ba45b9fd51dc4848"></a><a name="a34777ce8d3174036ba45b9fd51dc4848"></a>描述</p>
44     </th>
45     </tr>
46     </thead>
47     <tbody><tr id="ra7599f41f04548858a77e2062aad2cf5"><td class="cellrowborder" valign="top" width="15.031503150315032%" headers="mcps1.2.4.1.1 "><p id="a63ab1186072d4bcdb32d4e11b9243b57"><a name="a63ab1186072d4bcdb32d4e11b9243b57"></a><a name="a63ab1186072d4bcdb32d4e11b9243b57"></a>事件注入接口</p>
48     </td>
49     <td class="cellrowborder" valign="top" width="23.152315231523154%" headers="mcps1.2.4.1.2 "><p id="a3d9b89df15074475a45ed26503e22c21"><a name="a3d9b89df15074475a45ed26503e22c21"></a><a name="a3d9b89df15074475a45ed26503e22c21"></a>function injectEvent({KeyEvent: KeyEvent}): void;</p>
50     </td>
51     <td class="cellrowborder" valign="top" width="61.816181618161814%" headers="mcps1.2.4.1.3 "><p id="a33c82952289f40a09773ce2fed14f6aa"><a name="a33c82952289f40a09773ce2fed14f6aa"></a><a name="a33c82952289f40a09773ce2fed14f6aa"></a>注入按键事件的接口</p>
52     </td>
53     </tr>
54     </tbody>
55     </table>
56 
57 
58 ### 使用说明<a name="section789634518111"></a>
59 
60 当前仅提供了BACK按键的事件注入。
61 
62 当系统应用需要返回上一层时,通过注入接口将BACK键注入到多模服务,多模服务再上传到应用,以实现返回到上一层级目录的效果。使用方式如下所示:
63 
64 ```
65 // 引入提供的js接口库
66 import input from '@ohos.multimodalInput.inputEventClient'
67 
68 // 调用注入事件接口
69 var keyEvent = {
70     isPressed:true,           // 按键事件的按键类型:true:down false:up
71     code:2,                   // 按键对应的keycode, 例如back键的值为2
72     keyDownDuration:10,       // 按键按下到抬起的时长,单位ms
73 };
74 
75 var res = input.injectEvent({
76     KeyEvent: keyEvent
77 });
78 ```
79 
80 >![](figures/icon-note.gif) **说明:**
81 >新增的接口能力需要兼容原有的能力。
82 
83 ### 设备能力支持<a name="section789634518112"></a>
84 
85 |    设备     | 触摸屏 | 触摸板 | 鼠标 | 键盘 |
86 | :---------: | :----: | :----: | :--: | :--: |
87 |   rk3568    |   Y    |   Y    |  Y   |  Y   |
88 | hi3516dv300 |   Y    |   N    |  N   |  N   |
89 
90 ## 相关仓<a name="section135327891219"></a>
91 
92 多模输入子系统
93 
94 **multimodalinput\_input**
95 
96