Jump to content
Linze99

Sending q keystroke to background window

Recommended Posts

Linze99

Hi,

I want to send a q keystroke to the Remotedesktop window in the background whenevr I press Q in another window. This Is my code, but it doesnt work :(  :

 

#include <Misc.au3>

Local $hDLL = DllOpen("user32.dll")


While 1

   If _IsPressed ("51", $hDLL) Then
      ControlSend("192.168.178.91 - Remotedesktopverbindung", "", "", "q")
      
   EndIf
WEnd

Thx for the help :) 

Share this post


Link to post
Share on other sites
Xandy

I would run the script from the remote desktop, then I would ControlSend() to the application window there.

Share this post


Link to post
Share on other sites
Linze99

Thanks for the fast response . The problem is the remotedesktop runs on linux

 

Share this post


Link to post
Share on other sites
Linze99

Basically I want to send a keystroke to a background window

Share this post


Link to post
Share on other sites
Xandy

The Linux is rendering me powerless.  I'd really have to test against that environment to have any clue.

Can you give the remote desktop window focus without going into Linux mode?

I'm lost dude, sorry :(

Share this post


Link to post
Share on other sites
Linze99

I just treid it with sending the keystroke to the cmd.exe and it worked so the problem is the remotedektopconnection :( but thx for you help anyways

 

Share this post


Link to post
Share on other sites
Xandy

I can automate a remote connection fine from the remote connection if it's Windows, but I've never tried a Linux remote connection.

Share this post


Link to post
Share on other sites
Linze99

It is Windows just the raspberry pi that I access via remotedesktop is linux :P

So now I have to try it with another connection to get it working

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×