当前位置:网站首页>Detailed explanation of multi-mode input event distribution mechanism
Detailed explanation of multi-mode input event distribution mechanism
2022-07-04 21:06:00 【InfoQ】
One 、 Overview of multimode input
Two 、 Input event and device status data flow introduction

- The input event distribution process will first pass through the input event interception module , When an interceptor is registered , Entering the event will terminate and continue to report , The corresponding interceptor will intercept all input events . This event interception feature currently mainly supports barrier free mode .
- When there is no interceptor registration , The input event will be reported to the input event listening module , System level applications ( Such as : System settings 、 desktop ) By listening to input events , Support system level features ( Such as : The status bar is hidden / Disappear, etc ).
- The event monitoring module will not prevent the event from continuing to report ; Support event monitoring at the same time , Input events will continue to be reported .
- Key events will be reported to the subscription key distribution module for processing , Distribute to the corresponding application for processing , The event distribution process ends .
- Other touch screen events and mouse events will not go through the subscription key distribution module , It will continue to be reported to the application window for processing .
3、 ... and 、 Multimode input event distribution principle
- If there is no button on the mouse to press , Which target is the current mouse pointing to , Mouse input events are distributed to coordinate locked targets .
- If a button on the mouse is pressed , Take the target locked by the mouse coordinate when the first button is pressed as the distribution target , Until all the buttons are lifted .
- Touch screen input , Press the locked target with the first finger as the input event distribution target , Until all fingers are raised .
Four 、OpenHarmony 3.1 Interface description added in version


- Import module first
// Input method in the soft keyboard display logic by subscribing to the status of the physical keyboard : Insert / Pull out
// according to isPhysicalkeyboardExist The value of determines whether the soft keyboard pops up
...
let isPhysicalkeyboardExist = false;
inputDevice.on("change", (callback) => {
console.log("type: " + callback.type + ", deviceId: " + callback.deviceId);
inputDevice.getDevice(callback.deviceId, (ret) => {
console.log("The keyboard type of the device is: " + ret);
if (ret == keyboard.ALPHABETIC_KEYBOARD && callback.type == 'add') { // The hot plug device is keyboard
isPhysicalkeyboardExist = true;
} else if (ret == keyboard.ALPHABETIC_KEYBOARD && callback.type == 'remove') {
isPhysicalkeyboardExist = false;
}
});
});
...
listener: function(data) {
console.log("type: " + data.type + ", deviceId: " + data.deviceId);
}
// Cancel alone listener Listening in .
inputDevice.off("change", this.listener);
// Cancel all listening
inputDevice.off("change");// After canceling listening , The soft keyboard pops up by default

边栏推荐
- shp数据制作3DTiles白膜
- Go notes (1) go language introduction and characteristics
- Jmeter 之压测入门
- MySQL - database query - use of aggregate function, aggregate query, grouping query
- Poster cover of glacier
- Go language notes (4) go common management commands
- Pytorch---使用Pytorch实现LinkNet进行语义分割
- Go notes (3) usage of go language FMT package
- Explication détaillée du mécanisme de distribution des événements d'entrée multimodes
- Idea plug-in
猜你喜欢

JS卡牌样式倒计时天数

Gobang go to work fishing tools can be LAN / man-machine

Managed service network: application architecture evolution in the cloud native Era

【服务器数据恢复】某品牌服务器存储raid5数据恢复案例

剑指 Offer II 80-100(持续更新)

What if the win11 shared file cannot be opened? The solution of win11 shared file cannot be opened

多模輸入事件分發機制詳解

render函数与虚拟dom

Pytorch---使用Pytorch实现LinkNet进行语义分割

网件r7000梅林系统虚拟内存创建失败,提示USB磁盘读写速度不满足要求解决办法,有需要创建虚拟内存吗??
随机推荐
网件r7000梅林系统虚拟内存创建失败,提示USB磁盘读写速度不满足要求解决办法,有需要创建虚拟内存吗??
阿里测试师用UI自动化测试实现元素定位
Advantages of RFID warehouse management system solution
After inserting a picture into word, there is a blank line above the picture, and the layout changes after deletion
Summary of the mistakes in the use of qpainter in QT gobang man-machine game
LeetCode 8. 字符串转换整数 (atoi)
PermissionError: [Errno 13] Permission denied: ‘data.csv‘
idea恢复默认快捷键
From automation to digital twins, what can Tupo do?
BFC面试简述
What if the win11 shared file cannot be opened? The solution of win11 shared file cannot be opened
奏响青春的乐章
【观察】联想:3X(1+N)智慧办公解决方案,释放办公生产力“乘数效应”
Common verification rules of form components -1 (continuously updating ~)
工厂从自动化到数字孪生,图扑能干什么?
vim异步问题
What if win11u disk refuses access? An effective solution to win11u disk access denial
idea大小写快捷键
What are the functional modules of RFID warehouse management system solution
Après l'insertion de l'image dans le mot, il y a une ligne vide au - dessus de l'image, et la disposition est désordonnée après la suppression