Forum Discussion

TestOfficer's avatar
TestOfficer
Occasional Contributor
4 years ago

Press keyboard letter + mouse click

Hi TestComplete Community 🙂

 

my question is:

Is it possible to hold a keyboard button and due this click the left mouse button?

In my example I need to press "p" and while hat, the left mouse button has to be clicked.

 

I know with the function Click() it is possible to press a mouse button while STRG/SHIFT/ALT is hold.

But I don't need a control key, I need just a letter like "p".

 

Is that possible in any way?

 

Thanks in advance and best regards,

Klaus from Germany

  • AlexKaras's avatar
    AlexKaras
    4 years ago

    I've tried that already but it doesn't work.

    Consider LLPlayer object then.

    Something like:

    LLPlayer.KeyDown(112, 500); // check if 112 is correct code for 'p'

    LLPlayer.MouseDown(MK_LBUTTON, Sys.Desktop.MouseX, Sys.Desktop.MouseY, 500);

    LLPlayer.MouseUp(MK_LBUTTON, Sys.Desktop.MouseX, Sys.Desktop.MouseY, 500);

    LLPlayer.KeyUp(112, 500); // check if 112 is correct code for 'p'

     

    If the above does not help either, then I have no better idea at the moment but to ask Support via the https://support.smartbear.com/message/?prod=TestComplete form.