JavaScript-SDK

AnalogSense.js

JavaScript API for analog keyboard input.

Supported Keyboards/Devices

R Razer Synapse needs to be installed and running for analogue inputs to be received from this keyboard.

P The official firmware only supports polling, which can lead to lag and missed inputs.

F Custom firmware with full analog report functionality is available.

Usage

You can download and vendor the AnalogSense.js yourself, but you can also just load it straight from this repo:

<script src="https://analogsense.org/JavaScript-SDK/AnalogSense.js"></script>

Once loaded, the following global functions become available:

A device instance has the following members:

Scancodes

The scancodes provided by this library are primarily HID scancodes; most keys are mapped as seen on usage page 0x07 (A = 0x04, B = 0x05, …).

Control keys (usage page 0x0C) are mapped in the 0x3__ range, modulo 0x100:

OEM-specific keys are mapped in the 0x4__ range: