Documentation

Many commands in a control are simple key presses or keybinds. More complicated actions can be performed using the Phantom scripting language. For a documentation on Commander script commands and the Phantom scripting language, visit here.

Commander Overview

Commander is a versatile application that allows users to control their PC from an Android device. It comprises two components: the Commander Android app (referred to as the Client, available on the Google Play Store) and the Commander PC Server (available on the Microsoft Store). The Commander Android Client communicates with the Commander PC Server over a wireless network, sending commands that the Server interprets and executes on the PC.

For instance, the Commander Android Client might feature a button to simulate a keystroke on the PC. When the button is tapped, a command is sent to the Commander PC Server, which then simulates the keystroke. This functionality extends to a wide range of actions, from simple keystrokes to complex keyboard and mouse combinations. Additionally, the Server can gather information from the PC and relay it back to the Client, updating the Client’s display. The Phantom automation scripting language is employed to simulate complex tasks.

The Commander Android Client can display one or more Control Panels, each consisting of various controls that dispatch custom automation commands to the Commander PC Server. Users can create new control panels within the Client by selecting ‘Create New Panel’ from the Settings Menu. Typically, a Control Panel is tailored for a specific game, featuring controls to simulate key binds or mouse interactions for that game. Different panels can be activated depending on the game or game mode being played.

Example Commander Client Control Panels

Commander Interface

Tapping in any unoccupied space in Commander will show the main Commander menu at the bottom of the screen:

  1. Mode Indicator: Tapping this will toggle between ‘Live’ mode and ‘Edit’ mode. In Live mode, interacting with a Commander control sends commands to the Commander server, which is the standard mode for using Commander to interact with PC games. In Edit mode, tapping a control opens the Control Properties panel for customization. Additionally, controls can be dragged to new locations on the screen. Once switched back to ‘Live’, the control positions are locked in place.
  2. Open: This option opens a list of all the Commander control panels currently installed on your device. Select a panel to make it the active control panel in Commander.
  3. Create New Control: Tapping this opens the Control Properties panel, where you can create and customize a new control. Refer to the tutorial for an example of how to create a new control.
  4. Settings Menu: This opens a panel with a list of settings and options for Commander and the currently displayed Control Panel.

Connecting to the Commander Server

When you open Commander on your device, it will automatically attempt to connect to a Commander Server installed on a PC within your network. By default, it will try to reconnect to the last server used. If it doesn’t connect automatically, follow these steps:

  1. Tap the Settings Menu in the main Commander Interface.
  2. Select Connect. This will display a list of currently running Commander Servers on your network.
  3. Choose the server you wish to connect to.

If this is the first time connecting to the server, a prompt will appear to register the server connection. On the PC running Commander Server, a prompt will display a connection code to approve the connection. This approval is necessary to send commands from the Commander Android Client to the PC.

Note that you may need to approve a Windows Firewall exception when first running the Commander PC Server.

If an error appears indicating that Commander cannot connect to a Commander PC Server, even when the server is already registered, all registered servers can be removed by tapping ‘CLEAR CONNECTIONS’ from the settings menu. This will remove all registration codes from any Commander PC Servers and may clear up the connection issue. To reconnect to a server the server must be re-registered as described above.

To prevent all existing devices from connecting to a Commander PC Server, change the Remote Connection Token in the settings in Commander PC Server. Any Commander Android apps that need to connect to the server must clear connections and re-register the server.

Control Settings Panel

The Control Settings panel is used to change settings for a control. Tapping on any setting name will display more information about the setting.

Control Types

Commander has several different built-in control types. The control type can be changed by changing ‘Control Type’ in the Control Settings panel. A control panel with a sample of each control can be downloaded here.

A ‘Press’ control sends a command to the PC when the control is tapped.

An ‘On/Off’ control sends one command when the control is ‘On’, and can send a different command when the control is ‘Off’. Tap the control to change the state between ‘On’ and ‘Off’.

A Press/Release control sends one command when the control is pressed (tap and hold), and can send a different command when the control is released.

A ‘Text Only’ control displays customizable text.

A ‘Website’ control displays a website as provided in the control settings. It optionally also displays controls to refresh the page or forward/backward navigate.

Analog controls can be used to send different commands based on the location of the analog ‘actuator’. The actuator behavior can be changed in the settings (return to center on release, maintain position, move in configurable steps). Analogs can be 2-D (square or circular) or 1-D (constrained to horizontal and vertical). Special command variables are available in the to the command relating to the analog position (ANALOG_X, ANALOG_Y) or change in position (ANALOG_DX, ANALOG_DY).

Composite controls are containers that can hold one or more other controls. Composite controls can be moved around, copied, and pasted as a group, and can be used to more effectively organize controls.

Commander PC Server

The Commander PC Server is the application running on the host PC that interprets and executes Commander commands. The Commander Android app connects to the Commander PC Server over a wireless network and must be ‘registered’ with the Commander PC Server. Registration of Commander Android app gives it permission to control the PC, and is accomplished by sharing a token between the server and the app.

The main Commander Server screen displays the following:

  • Machine Name: This is the network name of the machine hosting the Commander PC Server. When connecting via the Commander Android app, this name will correspond to a connection to the PC where it is installed.
  • Listening Port: This is the port on which the Commander PC Server will accept new connections. This can be changed in the settings.
  • API Port: This is a port on which the Commander PC Server will listen for commands from other applications (applications other than a Commander Android app, which will connect on the Listening Port). This can be used to integrate with other applications on the host PC, such as game data miners or log file readers. Any Commander command script can be sent over the API.
  • Connections: The number of active Commander Android apps currently connected to the Commander PC Server.
  • Connection List: This lists information about all current active connections, including Host IP address, connection ID, connection status, the number of sent and received commands. Additional information includes a heartbeat counter and the remote Commander Android device name. Commander PC Server continuously pings the Commander Android app and awaits a response. When a response is receiver, the heartbeat (HB) counter resets. Otherwise the heartbeat decrements. When it reaches 0, the connection is assumed failed and is shut down.

Clicking on will open the Commander PC settings. Clicking on will hide the Commander PC Server. Clicking the Commander icon in the System Tray will restore the Commander PC Server when hidden.

In the Commander PC Server Settings (Options) panel, the following can be set:

  • Listening Port: This is the port on which the Commander PC Server will listen for new Commander Android app connections.
  • API Port: This is the port on which the Commander PC Server will listen for commands not originating from a Commander Android app. Setting this to 0 will disable API communication.
  • Event Log File: Selecting and setting this will save information that may be useful for debugging.
  • Remote Connection Token: This is the token shared with the Commander Android app when a new connection is registered. A Commander Android app cannot communicate with the Commander PC Server without this token. This token can be set to any value. Changing it to a new value will require all Commander Android apps to re-register the connection to this PC Server, after clearing all connections on the Commander Android app (by selecting ‘Clear Connections’ from the Commander Android app settings menu).
  • Hide Server at Startup: This will hide the Server when it starts, such that only the Commander icon is visible in the System Tray. Clicking the icon in the System Tray will restore Commander PC visibility.

Note that settings take effect when the Commander PC Server is restarted.