Giter VIP home page Giter VIP logo

remotecontrolserver's Introduction

Remote Control Server

Banner

Description

The Remote Control Server is needed to receive commands from any Remote Control App. The Remote Control apps allow you to remotely control your PC from your smartphone or tablet. You can download the latest stable version here: Server Releases

For developers

If you are interested in improving this software, feel free to contribute your code. If you would like to port this software to Mac OS or Linux, please contact me. Usage samples can be found below.

License information

The copyright belongs to Stephan Schultz. More detailed license information can be found in the project root.

Usage

Sending a data package

 Dim command As New Command
 command.source = Network.getServerIp()
 command.destination = Server.getCurrentApp().ip
 command.priority = Command.PRIORITY_MEDIUM
 command.data = Converter.stringToByte("Some fancy command!")
 command.send()

The above snippet will send a data package to the last connected device. The priority property lets the Network module decide which method it should use to send the data, based on the following table:

Priority Protocol Tries
PRIORITY_LOW UDP 1
PRIORITY_MEDIUM TCP 3
PRIORITY_HIGH TCP 5
PRIORITY_INDISPENSABLE TCP Until received

Receiving a data package

The TCP and UDP modules are constantly listening for incoming connections / data packages. If data was received and the source was authenticated, it will be processed as a Command object in the Remote module, where the used API will be detected. Depending on the API level, the command data will be parsed by the responsible API module. If it is a valid command, the server will execute it.

 Dim command As Command = New Command
 command.source = remoteEndPoint.Address.ToString
 command.destination = localEndPoint.Address.ToString
 command.data = receivedData
 command.process()

The above snippet is part of the listen() methods of the TCP and UDP module and initiates the processing of a command.

Simulating keyboard input

Pressing a key

To send a key up and down event for a single key use:

 'Simulate Esc key press
 Keyboard.sendKeyPress(Keys.Escape)
 
 'The method above will call:
 Keyboard.sendKeyDown(ByVal key As Keys)
 Keyboard.sendKeyUp(ByVal key As Keys)

Sending a shortcut

To simulate pressing multiple keys, use:

 'Send shortcut for Copy
 Dim shortcut = New List(Of Key) From {Keys.ControlKey, Keys.C}
 Keyboard.sendShortcut(shortcut)

Sending a string

If you want to press multiple keys after each other, use:

 'Send Hello World
 Keyboard.sendEachKey("Hello World")

Sending a unicode character

If you need to send characters that have no Key representation, use:

 'Send © (Copyright)
 'If you have the char
 Keyboard.sendUnicodeKeyPress("©")
 
 'If you have the unicode
 Keyboard.sendUnicodeKeyPress(169)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.