Jump to content

Recommended Posts

Posted

I have a client/server script that sends strings to a remote computer, then the remote computer simulate the string as keystrokes. So the client contains statement such as

 

UDPSend($iSocket, "E")

 

And the server just has

 

While 1
        Do
        ; We are waiting for the string "toto" OR "tata" (example script UDPSend): 4 bytes length.
        $sReceived = UDPRecv($iSocket, 4)
    Until $sReceived <> ""
    Send($sReceived)
WEnd

 

This works great for letters and numbers. Now I tried to emulate some special key press with

UDPSend($iSocket, "{DOWN}{ENTER}")

It is unfortunately not working on the remote (server) PC. What could the issue be ? I tried BinaryToString on the remote server in case the UDP received data is interpreted as binary but it does not fix the problem.

Posted

Or you could use the chr between 1 and 31 and associate it with the send sequence you would like :

Local $sReceived = "ABC" & chr(13) & "123" & chr (11) & "$%?"
$aChars = StringSplit ($sReceived, "")
For $i = 1 to $aChars[0]
  Switch Asc ($aChars[$i])
    Case 13
      Send ("{ENTER}")
    Case 11
      Send ("{DOWN}")
    Case Else
      Send ($aChars[$i])
  EndSwitch
Next

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...