python - 在 pyautogui 中使用功能键的宏
问题描述
我正在尝试获得与 AutoHotKey 应用程序类似的功能,以使用 pyautogui 在 python 脚本中捕获功能键(比如 F1)。但似乎没有什么可以捕获功能键作为输入。我附上了一个示例组合来打开“This_Pc”,只要我按下退出关键字,这个脚本就会一直运行。
import pyautogui x = '' while x != 'exit': y=input('enter the key') **'Here I would like to capture a function key'** print(y) if y != NULL: pyautogui.hotkey("win",'e') elif y == 'exit': x = 'exit'
当我按任何功能键作为输入时,无论如何都会触发代码提前谢谢
解决方案
推荐阅读
- epson - Epson JavaPOS ADK 安装未完成
- android - 使用 QuaggaJS 的 Phonegap
- node.js - 为什么我的导入@angular/core 的路径与在线教程不同?
- sql - 从 SQL Server 中的 MAX() GROUP BY 中选择行
- android - 允许用户为自己“创建一个新的活动”?
- vba - VBA - 识别从其他子程序/程序调用的子程序和函数
- regex - 如何找到具有最新时间戳的日志行?
- javascript - Angular 6中检查可滚动区域是否滚动到最大底部的最佳方法
- python-3.x - .any() 如何获取行而不是列?
- sas - SAS为宏的每个值重复一组语句