简体   繁体   English

打印键输入[自动热键]

[英]Print key input [auto hotkey]

I would like to print out what has been assigned to each combination of the keys "Shift" and "F1-12" when a user displays a help menu. 当用户显示帮助菜单时,我想打印出分配给“ Shift”和“ F1-12”键的每个组合的内容。 Currently I have been trying to do this by emulating a key press. 目前,我一直在尝试通过模拟按键来实现此目的。 How do you emulate a key press and print straight to a variable? 您如何模拟按键并直接打印到变量? Or is there a better method of getting what action has been assigned to a set of keys? 还是有更好的方法来获取已分配给一组键的操作?

Currently I have the following: 目前,我有以下内容:

Loop, 12
{
    msgList =%msgList% (Shift+) F%A_Index%  Send, {Shift}{F1} `n
}

too much text for another comment: 文字过多,无法发表其他评论:

The "action" triggered by a hotkey can be any combination of commands, like 500 lines of code, possibly with gotos, functions and if-statements..... how should this be printed out to the user? 由热键触发的“动作”可以是命令的任意组合,例如500行代码,可能还包含gotos,函数和if语句.....应如何将其输出给用户? The closest thing to this would be printing the entire source code. 与此最接近的是打印整个源代码。

If you want to only change the keys which are sent by Send (here: Shift + F1 , you could maybe store them in a variable and access it dynamically. something like this 如果您只想更改由Send的键(此处为Shift + F1 ,则可以将它们存储在变量中并动态访问它。)

shiftF1 = {Shift}{F1}
shiftF2 = {Shift}{F2}

+F1::send %shiftF1%
+F2::send %shiftF2%

Then, you'd be able to edit shiftF1 and print it out to the user 然后,您将能够编辑shiftF1并将其输出给用户

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM