Skip to content

Instantly share code, notes, and snippets.

@met
Last active October 25, 2025 23:22
Show Gist options
  • Select an option

  • Save met/1a1fa3a893ffdb6978c49653a05a7d33 to your computer and use it in GitHub Desktop.

Select an option

Save met/1a1fa3a893ffdb6978c49653a05a7d33 to your computer and use it in GitHub Desktop.
Set F1-F12 keys on/off for old Logitech keyboard K810 via WebHID_API
// Source: https://github.com/victor-st/k810-fn-config/blob/main/src/lib/k810-webhid.js
// Do not execute whole script, Just run step by step, eg. in browse JS console
// Step 1: request permission
let devices = await navigator.hid.requestDevice({
filters: [
{
vendorId: 0x46d, // 1133 - Logitech
productId: 0xb319, // 45849 - K810 keyboard device id
usagePage: 0x01, // Generic Desktop page - see details in https://usb.org/document-library/hid-usage-tables-13
usage: 0x06, // Keyboard type
}
]
});
// Step 2: open device
await devices[0].open();
// Step 3: change setting
devices[0].sendReport(0x10, new Uint8Array([0xff, 0x06, 0x15, true ? 0x00 : 0x01, 0x00, 0x00])); // set true/false for enable F1-F12 keys or not
// Step 4: disconnect
devices[0].forget(); // disconnect, revoke permission
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment