How to Hold Down Mouse while Key is Pressed?

戏子无情 提交于 2020-01-16 09:58:46

问题


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.

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!


回答1:


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/;



来源:https://stackoverflow.com/questions/14227649/how-to-hold-down-mouse-while-key-is-pressed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!