INSTALLATION & C++
Start using DriftLoom.
Intercept, change and forward Windows keyboard, mouse and supported game controller input through the DriftLoomSDK C++ SDK.
Windows 10 / 11 x64 · C++17 · Administrator rights for installation and activation
Inside your company ZIP
The Windows driver package is awaiting Microsoft signing. The Release SDK provides the following integration files.
| File | How to use it |
|---|---|
include/DriftLoomInput.h | Public C++17 entry point and types for DriftLoom Release. |
lib/DriftLoomSDK.lib | Static library containing the workflow and its Windows input transport. |
Activation.exe | Interactive device setup and authorization for the installed Release driver. |
examples/verification.cpp | Source for the activation console. |
examples/forward.cpp | Complete keyboard, mouse and gamepad editing example. |
1 Install the driver
When the Windows package becomes available, extract it before running its setup.
Console installation
- Open PowerShell as administrator in the extracted package directory.
- Use the console setup command documented in the package. Restart Windows if setup requests it.
Graphical installation
- Open the graphical setup provided with the package and approve elevation.
- Complete setup and restart Windows if requested.
2 Verifications
Authorize the installed DriftLoom Release driver before starting an input session. Use the C++ SDK in your application or run the interactive activation console.
C++ SDK activation
#include "DriftLoomInput.h"
#include <windows.h>
#include <iostream>
int main() {
const auto setup = DriftLoom::PrepareDriftLoomDevices();
if (setup.error) {
std::cerr << "Device setup failed (" << setup.error << "): " << setup.detail << '\n';
return 1;
}
if (setup.restartRequired) {
std::cout << "Restart Windows, then run verification again.\n";
return 2;
}
if (!setup.ready) {
std::cerr << "The driver is still unavailable.\n";
return 1;
}
const HANDLE input = GetStdHandle(STD_INPUT_HANDLE);
DWORD mode = 0;
if (!GetConsoleMode(input, &mode) || !SetConsoleMode(input, mode & ~ENABLE_ECHO_INPUT)) {
std::cerr << "Open an interactive administrator console.\n";
return 1;
}
std::string key;
{
struct RestoreEcho {
HANDLE input;
DWORD mode;
~RestoreEcho() { SetConsoleMode(input, mode); }
} restore{input, mode};
std::cout << "Customer activation key: " << std::flush;
std::getline(std::cin, key);
}
std::cout << '\n';
if (key.empty()) {
std::cerr << "An activation key is required.\n";
return 1;
}
const auto result = DriftLoom::VerifyDriftLoomRelease(key);
SecureZeroMemory(key.data(), key.size());
if (!result) {
std::cerr << result.stage << " / " << result.reason << ": " << result.message
<< " (Windows error " << result.error << ")\n";
return 1;
}
std::cout << "DriftLoom Release activated.\n";
}
PrepareDriftLoomDevices() associates supported devices using the installed packages. If Windows requests a restart, restart and rerun the tool. VerifyDriftLoomRelease(key) returns the authorization result and its stage, reason, message and Windows error code.
Activation console
In an administrator PowerShell window, open the extracted DriftLoom SDK directory and run the command below. Enter your customer key at the prompt.
.\Activation.exeExit code 0 means activation succeeded. Exit code 1 reports an error. Exit code 2 requests a Windows restart before retrying.
Both methods require administrator rights, the installed Release licensing agent and Internet access. Repeat activation after restarting Windows or reloading the driver.
3 Receive, change, forward
Run the following example after activation. It tags the keyboard A events, caps relative horizontal mouse movement, and applies a dead zone to selected controller axes. The DriftLoom workflow uses Arrival-triggered nonblocking drain to capture and forward its inputs.
#include "DriftLoomInput.h"
#include <algorithm>
#include <cmath>
#include <exception>
#include <iostream>
int main() {
using namespace DriftLoom;
try {
DriftLoomEdits edits;
// Tag letter A down/up events; keep their scan code and transition.
edits.keyboard = [](DriftLoomKeyboard& key) {
if (key.scanCode == 0x1e && (key.flags & 0x6) == 0)
key.extraInformation = 0x5449544e;
};
// Limit small relative-motion bursts without changing buttons or wheels.
edits.pointer = [](DriftLoomPointer& mouse) {
if ((mouse.flags & 1) == 0)
mouse.x = std::clamp<std::int32_t>(mouse.x, -32, 32);
};
// Remove drift on the native left stick (XUSB and GIP).
edits.nativePad = [](DriftLoomPadState& pad) {
if (std::abs(pad.leftX) < 1800) pad.leftX = 0;
if (std::abs(pad.leftY) < 1800) pad.leftY = 0;
};
// Apply a dead zone to decoded Generic Desktop X/Y HID axes.
edits.hidAxis = [](DriftLoomHidAxis& axis) {
if (axis.usagePage == 1 && (axis.usage == 0x30 || axis.usage == 0x31)
&& std::abs(axis.value) < 0.08) axis.value = 0.0;
};
std::cout << "Testing DriftLoom input after Release activation.\n";
(void)DrainAfterArrival(16, 2000, edits);
} catch (const std::exception& error) {
std::cerr << error.what() << '\n';
return 1;
}
}
Build either example in an x64 Visual Studio Developer PowerShell. Run this command from the extracted DriftLoom SDK directory.
cl /std:c++17 /EHsc /MT /Iinclude examples\forward.cpp lib\DriftLoomSDK.lib setupapi.lib newdev.lib cfgmgr32.lib hid.lib advapi32.lib user32.lib comctl32.lib ole32.libInput behavior in DriftLoom
- Group adjacent keyboard packets from the same unit.
- Deliver button transitions separately from motion.
- Resumes after partial class delivery immediately while progress continues, with bounded retry when the class consumes nothing.
Useful SDK calls
The calls below use the DriftLoom namespace.
| Call | What it does |
|---|---|
std::size_t DrainAfterArrival(unsigned burstLimit, unsigned firstArrivalTimeout, const DriftLoomEdits& edits = {}) | Wait for the initial input. Then drain queued packets with nonblocking reads, stop at the first empty poll or burst limit, and acknowledge each packet individually. |
PrepareDriftLoomDevices() | Associate supported devices with the installed packages and check whether Windows must restart. |
VerifyDriftLoomRelease(key) | Authorize the loaded Release driver with the customer key. |
DriftLoomEdits::keyboard | Change the scan code, flags or attached extra information. A key remap must handle both press and release. |
DriftLoomEdits::pointer | Change movement, button transitions and wheel data. Preserve the coordinate mode unless converting the coordinates as well. |
DriftLoomEdits::nativePad | Edit XUSB or GIP buttons, sticks and triggers. Trigger values range from 0 to 255 for XUSB and 0 to 1023 for GIP. |
DriftLoomEdits::hidAxis | Edit decoded HID or XInputHID absolute axes in the range −1 to 1. The usage and collection identify the control. |
DriftLoomEdits::hidPayload | Edit HID or XInputHID report bytes for a known report layout. The byte view is valid only during the callback. |
The optional edits callbacks run on the capture thread before the workflow applies its own routing and delivery rules. Leave an editor empty to retain that family's incoming fields. HID payload editing receives bytes after the fixed report ID, and decoded axis edits take precedence for overlapping fields. Keep callbacks short. For cancellation, keep the manual-reset Windows event open throughout the call. Capture and delivery failures use std::system_error.
If something fails
- Setup or capture is unavailable
- Check that the Windows package matches DriftLoom and that any restart requested by setup has completed.
- Release capture is refused
- Confirm that verification succeeded for the currently loaded driver and the correct product.
- Unexpected frame timing
- Check the grouping and timing behavior documented above before comparing metrics across products.
Activation and compatibility
DriftLoom uses the Windows HID function-driver association for keyboard and mouse. Supported HID, XUSB, XInputHID and GIP controllers use per-device filter associations. Support depends on the device's transport and report profile. A compatible device must be associated with this Release before its reports appear in the SDK.
The Release authorization applies to the loaded driver instance.