wtRemote

This companion program for Win-Test makes it possible to use additional plain PC keyboards and/or mice to trigger Win-Test Lua scripts. These auxiliary devices are attached to your main Win-Test machine, alongside your regular keyboard and mouse.

wtRemote runs as a small icon in the Windows notification area (system tray). Right-clicking this icon opens a menu with Settings..., About..., Show command-line options and Exit. Double-clicking the icon also opens the Settings window directly.

On first run (before any setting has been saved), the Settings window opens automatically. On every following launch, wtRemote starts silently in the tray, using the last saved settings.

Setup

This program requires the Interception driver to be installed (Credit: Francisco Lopes da Silva). Open a command line, browse to the directory where the installer is located, and run "install-interception /install" to install the driver (and "install-interception /uninstall" to uninstall it, if needed). This requires administrator rights and a reboot to complete the installation.

You may also need interception.dll in the same folder as wtRemote.exe. It can be found in this package, in the interception_dll folder. Since wtRemote is a 32-bit application, always use the 32-bit build of interception.dll, even on a 64-bit version of Windows - a process can only load DLLs matching its own architecture, not the operating system's.

Once Interception is installed, start wtRemote and open Settings from the tray icon to access and set the various parameters. If you have enough room on your desk, you can attach several keypads (or even full keyboards) and/or several mice. Auxiliary devices must be attached before starting wtRemote. In all cases, your main keyboard and your main mouse MUST NOT be selected as "auxiliary" (otherwise, they will no longer be usable in your Windows environment) - wtRemote only ever reacts to auxiliary devices, never to your main keyboard or mouse.

In the auxiliary devices setup dialog, check the auxiliary devices you want to use (identified by the small LED to the left of each checkbox), and assign a different index number to each of them (otherwise, devices of the same type will send the same remote command and will be considered identical by Win-Test).

In the Settings window, as usual, you must set the network broadcast address. It can be restricted to your own PC by using 127.255.255.255, or broadened to reach other Win-Test stations on your LAN. Alternatively, you can specify a destination PC by entering its name (the Station name in Win-Test) instead of a broadcast address.

A button next to the broadcast address field can propose one for you: it looks at your network interfaces and suggests the most suitable broadcast address, computed from each interface's actual subnet mask (private Class C addresses are preferred, then Class B, then Class A, then any other address found).

Settings window - OK / Cancel / Apply

- Apply saves your settings immediately and restarts the network and the auxiliary devices interception with the new values, without closing the window - handy to test right away and fine-tune further if needed.
- OK does the same as Apply, then hides the Settings window. wtRemote keeps running in the tray.
- Cancel, or closing the window with its [X], discards any unsaved change, reverts to the last saved settings, and hides the window as well.
- Exit (tray menu only) actually terminates wtRemote.

Once your parameters are set, click OK: the window disappears into the tray, and wtRemote keeps running in the background.

From that point, every keystroke or mouse event (button or wheel) from an auxiliary device generates a remote text command with parameters, sent to Win-Test. You just need to write a script and assign it to this text command to process it. For simplicity and troubleshooting, the full command text with its arguments is always displayed in the Settings window; the tray icon also briefly animates for a few seconds each time a command is sent, as a visual confirmation even while the window is hidden.

The keypads/keyboards send the virtual key code, the state of the modifiers (Shift, Alt, Ctrl), and the index of the device.
The mouse(s) send an event code (left, right or middle button, or scroll wheel), the wheel angle when applicable, and the index of the device.

To demonstrate the capabilities, I wrote two basic scripts (auxkbd.wts and auxmouse.wts) that you can enhance and adapt to fit your needs. Copy (or move) them into your /scripts directory, and assign the AUXKBD and AUXMOUSE text commands to each of them using the script manager.

Command-line options

wtRemote can be started with the following optional arguments - mainly useful if you want to run several independent instances (each with its own auxiliary configuration and/or network destination) without them interfering with one another:

wtRemote[.exe] [{-a|--alternate-appdata} IniFileDirectory] [{-i|--alternate-ini} IniFile.ini]

- -a | --alternate-appdata <dir>: use <dir> instead of the default "...\Win-Test\" folder (a "cfg" sub-folder is still created underneath it, as usual).
- -i | --alternate-ini <file>: use <file> (a file name only, not a path) instead of the default "wtRemote.ini".

If an invalid directory or file name is given, wtRemote shows an error message and exits immediately, without opening any window.

Notes:

- If you're tempted to use additional 102-key keyboard(s), it is advisable that their layout be identical to your main keyboard's layout. It will be easier to recognize the key codes transmitted as the first argument of the text command. It is also recommended to stay away from "exotic" keys like PrintScreen, Scroll Lock or Pause, which sometimes generate inconsistent key codes and/or modifier states. From experience, this can also depend on the keyboard layout.
- On some auxiliary keyboards/keypads, the NumLock key can be ignored by the system (Windows), so its state will _normally_ "follow" the Num Lock state of your main keyboard (this depends on the keyboard/keypad and its connection type). In all cases, and for simplicity, only the numeric keys' VK codes are sent (not the arrow-key codes), and the Num Lock key sometimes generates its own remote command (depending on the keyboard). To be safe, it is recommended to keep Num Lock engaged and to avoid using the Num Lock key itself.
- Some numeric keypads have a "00" or "000" key that internally generates several identical key codes (96) in a row, within a very short time (less than 100 ms). A specific process has been written to generate only ONE remote command in this case, identical to the regular "0" key.
- The more resourceful contesters can dismantle cheap mice and replace or modify the scroll wheel encoder, for more convenient control in some use cases (CW speed, RIT setting, etc.).