Is it possible to have a virtual mouse or keyboard in Remote Desktop Windows Server independent from my mouse?

Saeed Fazlollahzadeh 21 Reputation points
2022-11-11T21:48:10.977+00:00

Hi, I searched a lot for this but did not found any solution.

I'm testing it with a simple HTML/JS counter button when I click on that button, it increments from 1 to infinite number.

I know when I connect to RDP, it uses my mouse and keyboard as input (I hope I'm right), and I tried some ways like writing a python script or using auto clicker apps. But my issue is if I close the session or even minimize it, the click in the session does not either work and it stops because of having no input.

I even tried with on-screen keyboard to simulate, but it doesn't work either.

Is there anyway or any apps or even in any programming language a way to click some where or using a virtual keyboard in RDP and it still working after closing the session?

Windows development | Windows API - Win32
{count} votes

Answer accepted by question author
  1. Junjie Zhu - MSFT 21,736 Reputation points
    2022-11-14T09:40:36.593+00:00

    Hello @Saeed Fazlollahzadeh ,
    Welcome to Microsoft Q&A!

    Here is a workaround, replace the current session with the console.

    1. Execute query session to view the currently logged in session.
    2. Execute tscon rdp-tcp#0 /dest:console. 260035-image.png

    rdp-tcp#0 is your RDP session.

    After the two commands are executed, you will be disconnected, but the keyboard and mouse will work normally. In my test, SetCursorPos returns Ture normally.

    Thank you.
    Junjie


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    3 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.