当前位置:网站首页>Shutter web hardware keyboard monitoring
Shutter web hardware keyboard monitoring
2022-07-05 06:08:00 【bawomingtian123】
Flutter web Use keyboard monitoring when developing pages , I found a circle on the Internet and recommended it RawKeyboardListener Components
However, in the actual development process, it is found that the component often fails, resulting in the inability to monitor keyboard input .
Now the solution , Use HardwareKeyboard object .
How to get HardwareKeyboard Single case , Then add your own callback method
late HardwareKeyboard hardwareKeyboard;
@override
void initState() {
hardwareKeyboard = HardwareKeyboard.instance;
hardwareKeyboard.addHandler((event) {
print("event=${event.toStringShort()}");
return true;
});
super.initState();
}
In this way, the hardware keyboard input can be monitored every time .
event=KeyDownEvent#b9cb2
event=KeyUpEvent#b073c
event=KeyDownEvent#8425d
event=KeyUpEvent#b8cec
event=KeyDownEvent#3c7a9
event=KeyUpEvent#c0b31
event=KeyDownEvent#9d155
event=KeyUpEvent#9b0ca
event=KeyDownEvent#5bd0b
event=KeyUpEvent#e8fdf
event=KeyDownEvent#78c1b
event=KeyUpEvent#0abb7
The log table output is as above , We can totally rely on event Object to determine the current key input , Very convenient .
边栏推荐
- Data visualization chart summary (II)
- How to adjust bugs in general projects ----- take you through the whole process by hand
- Brief introduction to tcp/ip protocol stack
- F - Two Exam(AtCoder Beginner Contest 238)
- [rust notes] 14 set (Part 2)
- MIT-6874-Deep Learning in the Life Sciences Week 7
- 【Rust 笔记】16-输入与输出(下)
- [rust notes] 15 string and text (Part 1)
- Introduction and experience of wazuh open source host security solution
- 可变电阻器概述——结构、工作和不同应用
猜你喜欢
CF1634 F. Fibonacci Additions
LVS简介【暂未完成(半成品)】
R language [import and export of dataset]
RGB LED infinite mirror controlled by Arduino
个人开发的渗透测试工具Satania v1.2更新
Time of process
快速使用Amazon MemoryDB并构建你专属的Redis内存数据库
MatrixDB v4.5.0 重磅发布,全新推出 MARS2 存储引擎!
[practical skills] technical management of managers with non-technical background
【实战技能】非技术背景经理的技术管理
随机推荐
Codeforces Round #732 (Div. 2) D. AquaMoon and Chess
Error ora-28547 or ora-03135 when Navicat connects to Oracle Database
Configuration and startup of kubedm series-02-kubelet
1040 Longest Symmetric String
Traditional databases are gradually "difficult to adapt", and cloud native databases stand out
Some common problems in the assessment of network engineers: WLAN, BGP, switch
[practical skills] technical management of managers with non-technical background
How many checks does kubedm series-01-preflight have
Wazuh开源主机安全解决方案的简介与使用体验
927. Trisection simulation
Appium foundation - use the first demo of appium
Kubedm series-00-overview
2022 极术通讯-Arm 虚拟硬件加速物联网软件开发
One question per day 1447 Simplest fraction
CF1637E Best Pair
[rust notes] 14 set (Part 2)
2022 pole technology communication arm virtual hardware accelerates the development of Internet of things software
1039 Course List for Student
LaMDA 不可能觉醒吗?
【Rust 笔记】14-集合(上)