当前位置:网站首页>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#0abb7The log table output is as above , We can totally rely on event Object to determine the current key input , Very convenient .
边栏推荐
- One question per day 1765 The highest point in the map
- Full Permutation Code (recursive writing)
- Graduation project of game mall
- MIT-6874-Deep Learning in the Life Sciences Week 7
- Implement a fixed capacity stack
- Analysis of backdoor vulnerability in remote code execution penetration test / / phpstudy of national game title of national secondary vocational network security B module
- 1996. number of weak characters in the game
- The difference between CPU core and logical processor
- leetcode-556:下一个更大元素 III
- Smart construction site "hydropower energy consumption online monitoring system"
猜你喜欢

RGB LED infinite mirror controlled by Arduino

从Dijkstra的图灵奖演讲论科技创业者特点

In this indifferent world, light crying

LeetCode 0108.将有序数组转换为二叉搜索树 - 数组中值为根,中值左右分别为左右子树

Spark中groupByKey() 和 reduceByKey() 和combineByKey()

Data visualization chart summary (II)

Implement a fixed capacity stack

AtCoder Grand Contest 013 E - Placing Squares

leetcode-6110:网格图中递增路径的数目

Dynamic planning solution ideas and summary (30000 words)
随机推荐
1040 Longest Symmetric String
Error ora-28547 or ora-03135 when Navicat connects to Oracle Database
Graduation project of game mall
AtCoder Grand Contest 013 E - Placing Squares
Introduction to convolutional neural network
Collection: programming related websites and books
Data visualization chart summary (I)
LeetCode 0107.二叉树的层序遍历II - 另一种方法
Binary search template
Daily question 1342 Number of operations to change the number to 0
[rust notes] 16 input and output (Part 1)
【Rust 笔记】15-字符串与文本(下)
7. Processing the input of multidimensional features
1.13 - RISC/CISC
Scope of inline symbol
Groupbykey() and reducebykey() and combinebykey() in spark
1039 Course List for Student
数据可视化图表总结(二)
SQLMAP使用教程(二)实战技巧一
Convolution neural network -- convolution layer