微信公众号:OpenCV开发者联盟
关注获取更多计算机视觉与深度学习知识
键盘事件
keyPressEvent()
keyReleaseEvent()
grabKeyboard()
releaseKeyboard()
代码演示部分
1def keyPressEvent(self, event):
2 print("key press response", event.key())
3 if event.key() == QtCore.Qt.Key_PageUp:
4 self.on_back_image_view()
5
6 if event.key() == QtCore.Qt.Key_PageDown:
7 self.on_forward_image_view()
8
9def keyReleaseEvent(self, event):
10 print("key release response", event.key())
11 if event.key() == QtCore.Qt.Key_Left:
12 self.on_back_image_view()
13
14 if event.key() == QtCore.Qt.Key_Right:
15 self.on_forward_image_view()
1def keyPressEvent(self, a0: QtGui.QKeyEvent):
2 print("key press response", a0.key())
3 if a0.key() == QtCore.Qt.Key_PageUp:
4 self.on_back_image_view()
5
6 if a0.key() == QtCore.Qt.Key_PageDown:
7 self.on_forward_image_view()
8
9def keyReleaseEvent(self, a0: QtGui.QKeyEvent):
10 print("key release response", a0.key())
11 if a0.key() == QtCore.Qt.Key_Left:
12 self.on_back_image_view()
13
14 if a0.key() == QtCore.Qt.Key_Right:
15 self.on_forward_image_view()
扫码关注
OpenCV开发者联盟,
专注各种语言的OpenCV开发教程分享
OpenCV周边开发技术应用!
扫码查看OpenCV+OpenVIO+Pytorch系统化学习路线图
推荐阅读
CV全栈开发者说 - 从传统算法到深度学习怎么修炼
2022入坑深度学习,我选择Pytorch框架!
Pytorch轻松实现经典视觉任务
教程推荐 | Pytorch框架CV开发-从入门到实战
OpenCV4 C++学习 必备基础语法知识三
OpenCV4 C++学习 必备基础语法知识二
OpenCV4.5.4 人脸检测+五点landmark新功能测试
OpenCV4.5.4人脸识别详解与代码演示
OpenCV二值图象分析之Blob分析找圆
OpenCV4.5.x DNN + YOLOv5 C++推理
OpenCV4.5.4 直接支持YOLOv5 6.1版本模型推理
OpenVINO2021.4+YOLOX目标检测模型部署测试
比YOLOv5还厉害的YOLOX来了,官方支持OpenVINO推理