How to Hold Down Mouse while Key is Pressed?

Tag: autohotkey Author: C20051015002 Date: 2012-12-23

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:

    if GetKeyState("Up", "P"){
        Click 112, 429, down
    if not GetKeyState("Up", "P"){

Thanks in advance for any help!

@lanuk_hahs - you should mark this solved.

Other Answer1

Here is the code

    if( not GetKeyState("LButton" , "P") )
        Click down

F1 Up::Click up

Read the documentation.;


Ha ha, Armin, you wrote the same thing here: click me
@BGM Please note the asked and edit dates. I updated the answer (which is always preferable) to a more correct version.
I only meant to point out that you get around. :) Our fellow OP should mark his thread!