简体   繁体   English

如何在按下按键时按住鼠标?

[英]How to Hold Down Mouse while Key is Pressed?

I am new to autohotkey and apologize for my lack of programming knowledge, but as stated in the title, I am trying to make it so while I hold down a certain key on my keyboard, the mouse will be held down at a certain location as well. 我是autohotkey的新手,并为我缺乏编程知识而道歉,但正如标题中所述,我正努力做到这一点,当我按住键盘上的某个键时,鼠标将被按住某个位置作为好。

The problem I am having is that when I release the key on my keyboard (in this case the "up" key), the cursor is still kept down. 我遇到的问题是当我在键盘上释放键时(在这种情况下是“向上”键),光标仍然保持不动。 Here is my code so far: 到目前为止,这是我的代码:

$Up::
Loop{
    if GetKeyState("Up", "P"){
        Click 112, 429, down
    }
    if not GetKeyState("Up", "P"){
        break
    }
}

Thanks in advance for any help! 在此先感谢您的帮助!

Here is the code 这是代码

F1::
    if( not GetKeyState("LButton" , "P") )
        Click down
return

F1 Up::Click up

Read the documentation. 阅读文档。 http://www.autohotkey.com/docs/ ; http://www.autohotkey.com/docs/ ;

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

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