Back to Hub
HARDWARE INTEGRATION • MAY 2026

Reading Raw Scancodes via the WebHID API.

When you press a key in a standard web application, the physical electrical signal travels through the keyboard controller, the USB bus, the operating system's HID driver, the browser's C++ input thread, and finally into the JavaScript Event Loop as a keydown event. This entire chain introduces unpredictable latency and subjects your typing to the OS's artificial "key repeat delay" settings.

For power users with 1000Hz polling-rate custom mechanical keyboards (like QMK or ZMK boards), this software abstraction is unacceptable. NitroIDE offers a highly experimental "Raw Input" mode utilizing the WebHID API.

Bypassing the Operating System

WebHID allows NitroIDE to request direct, low-level access to Human Interface Devices. Instead of waiting for the browser to synthesize a DOM KeyboardEvent, we read the raw, 8-byte hexadecimal input reports streaming directly off the USB or Bluetooth endpoint of the keyboard.

// Requesting direct access to a connected QMK Mechanical Keyboard
const devices = await navigator.hid.requestDevice({
  filters: [{ vendorId: 0xFEED }] // Example QMK Vendor ID
});
const keyboard = devices[0];
await keyboard.open();

// Intercepting raw USB hex payloads at 1000Hz
keyboard.addEventListener('inputreport', event => {
  const { data } = event;
  // Byte 2 usually contains the primary scancode
  const scanCode = data.getUint8(2);
  
  if (scanCode !== 0) {
    processRawScancode(scanCode);
  }
});

N-Key Rollover (NKRO): Standard DOM events struggle with complex, simultaneous key chords due to OS-level interception. By reading the raw HID bitmask, NitroIDE can process true N-Key Rollover, allowing developers to execute complex, 6-key Vim macro chords with mathematical precision.

The Ultimate Tactile Workflow

Because we process the raw hardware interrupts, typing in NitroIDE's Raw Input mode feels exactly like typing into a bare-metal Linux terminal. The keystroke is rendered to the Canvas 2D engine before the host operating system even finishes calculating its own accessibility overlays.

Feel the Speed.

Connect a compatible mechanical keyboard and enable WebHID Raw Input mode.

Launch Editor