HOGP inputmap reference
This page covers inputmap configuration for standard HID keys only. Keys with default mappings require no recording. Use the rules below to customize actions, reuse mappings or distinguish key values, and verify them with the matching App and real glasses.
Download an editable five-button template#
This example maps Page 0x000C Usage 0x0042, 0x0043, 0x0044, 0x0045, and 0x0041 to up, down, left, right, and confirm respectively, matching the sample remote's captured format. These are not universal third-party device encodings. Replace them using your Report Map and captured values. Omitting application / rid leaves those fields unrestricted.
{
"version": 1,
"rules": [
{
"type": "usage_key",
"page": 12,
"usage": 66,
"key": 0
},
{
"type": "usage_key",
"page": 12,
"usage": 67,
"key": 1
},
{
"type": "usage_key",
"page": 12,
"usage": 68,
"key": 2
},
{
"type": "usage_key",
"page": 12,
"usage": 69,
"key": 3
},
{
"type": "usage_key",
"page": 12,
"usage": 65,
"key": 4
}
]
}Match HID input on the left; choose glasses output on the right#
| Fields | Meaning and values |
|---|---|
| version / rules | The current protocol version is 1. rules contains the complete rule array; each submission replaces the entire table. JSON supports neither comments nor bare 0x numbers. Decimal integers are recommended. |
| type | This guide uses usage_key or value_match; names are case-sensitive. |
| page / usage | HID Usage Page and Usage, range 0…65535, from the Report Map or actual captures. These are not glasses action IDs. |
| application | Optional HID Application Collection identifier, usually (Usage Page << 16) | Usage. This is not the plugin ID. Use the actual captured value; omission or 0 means no restriction. |
| rid | Optional Report ID, range 0…255. Use the actual report value. Omission or 0 means unrestricted. Do not copy another device's r value blindly. |
| key / values | Output uses this page's ring_key IDs. They differ from HID usage values and GMP GM_PLUGIN_BUTTON_* numbers. |
Key rules: choose based on actual reports#
Each block below is a complete single-rule file. Input values illustrate structure and must be replaced with real device data. Combine rules in one rules array and import once; importing separate files successively replaces previous tables.
value_match: map distinct action values to confirm and double click
{
"version": 1,
"rules": [{
"type": "value_match", "page": 65280, "usage": 1,
"values": [{"value": 1, "key": 4}, {"value": 2, "key": 58}]
}]
}| type | Suitable input | Configuration notes |
|---|---|---|
| usage_key | Ordinary physical buttons with a distinct Usage per action | page, usage, and key, optionally application and rid. Start with App recording. |
| value_match | One Usage reports different integer values for different actions | List value / key entries in values. Do not duplicate one Usage as several ordinary buttons. At most 6 values per rule. |
Output IDs available for selection and import in the current App#
| ID | Name | Purpose |
|---|---|---|
| 0 / 1 / 2 / 3 | UP / DOWN / LEFT / RIGHT | Navigation directions. |
| 4 | SELECT | Confirm; ordinary press/release lets the glasses distinguish short and long presses. |
| 5 / 6 / 7 | BACK / HOME / MENU | Back, home, and menu; behavior depends on the current UI. |
| 8 / 9 / 10 | NEXT / PREV / PLAY_PAUSE | Next, previous, and play/pause; handled by corresponding system functions. |
| 11 / 12 / 13 | VOL_UP / VOL_DOWN / MUTE | Volume and mute; visible effects depend on product state. |
| 54 / 55 | PAGE_UP / PAGE_DOWN | Turn the page. |
| 56 / 57 | SCROLL_UP / SCROLL_DOWN | Scroll. |
| 58 | DOUBLE | Dispatch an action already distinguished by the device as a double click. |
| 65535 | Unset / no-output placeholder | A value_match output slot may emit no action. In usage_key, this value skips the entry and continues default matching; it does not disable the key. |
Short press, long press, double-click and Ignore#
- Map an ordinary confirm button to SELECT(4), with stable press and release reports. The glasses distinguish short and long presses by duration, not report repetition count. The foreground application determines final behavior.
- DOUBLE(58) represents a double-click action already distinguished by the device, using a separate Usage or a different value under one Usage. This mapping does not automatically combine two identical short-press reports into a double click.
- The “Ignore” dropdown omits the ordinary recorded rule; uncovered input may still match firmware defaults. usage_key with key 65535 also skips the entry rather than forcibly disabling input. Advanced-rule output slots set to 65535 dispatch no action for that slot. Verify the specific rule on the target device.
Capacity, validation and saving#
The App queries glasses capabilities on page entry; limits may vary by release. Save the results and matching version information during initial integration. Valid JSON is deliverable only after App validation, glasses confirmation, and physical-device testing.
The complete mapping table is validated, replaced, and saved with the bound device. Unpairing clears it. Use the App's “Clear mapping” to restore defaults; file import currently rejects an empty rules array.
| Item | Current reference-implementation limits |
|---|---|
| inputmap JSON | Version 1; the entire UTF-8 table is limited to 8192 bytes. The App validates against queried glasses capabilities and handles transfer chunking. Users need not split files manually. |
| usage_key | 16 rules. |
| value_match | 4 rules, each with at most 6 values. |
| HID descriptor parsing budget | Report Map: at most 512 bytes, 8 Report characteristics, 40 parsed fields, and 16 Usages per field. These are reference-firmware resource limits, not HOGP standard limits. |
How mapped values reach a GMP plugin#
After the glasses decode and map accessory reports, the Host converts supported system buttons into GM_PLUGIN_EVENT_BUTTON. Read event->data.button.button and action in your existing on_event callback. Input adaptation occurs on the glasses; the plugin does not receive or parse inputmap JSON.
| inputmap output | GMP button | GMP action |
|---|---|---|
| UP(0) / DOWN(1) / LEFT(2) / RIGHT(3) | GM_PLUGIN_BUTTON_UP(2) / DOWN(3) / LEFT(4) / RIGHT(5) | GM_PLUGIN_BUTTON_ACTION_TRIGGER(6). Holding may repeat; handle as navigation steps. |
| SELECT(4) | GM_PLUGIN_BUTTON_PRIMARY(1) | Produces SINGLE / LONG and related actions from actual hold duration; handle RELEASE through the corresponding flow. |
| DOUBLE(58) | GM_PLUGIN_BUTTON_PRIMARY(1) | GM_PLUGIN_BUTTON_ACTION_DOUBLE。 |
| PAGE_UP(54) / PAGE_DOWN(55) | GM_PLUGIN_BUTTON_PAGE_UP(6) / PAGE_DOWN(7) | TRIGGER。 |
| SCROLL_UP(56) / SCROLL_DOWN(57) | GM_PLUGIN_BUTTON_SCROLL_UP(8) / SCROLL_DOWN(9) | TRIGGER。 |
| BACK(5) / HOME(6) | GM_PLUGIN_BUTTON_BACK(10) / HOME(11) | TRIGGER; also verify behavior with the plugin Host and current UI. |
| MENU, Media and Volume Keys, etc. | The current GMP button bridge does not expose a corresponding button for each of these | Not every dropdown action becomes a GMP event; some are handled by system features. |
Final checks before delivery#
- Confirm JSON inputs come from the actual Report Map and reports of the current third-party device firmware. Record the physical key for each rule; do not reuse another model's values blindly.
- Wear the glasses, import in the App, and wait for success. Test trigger, release, and retrigger for every rule. With multiple Reports, verify that inputs do not activate the wrong buttons.
- Test both the target system UI and GMP plugin. An available button event does not mean every foreground application supports the action.
- Verify reconnection and reboot recovery. Keep validated JSON and version information. Retest after descriptor or action-encoding changes; updating the product description alone is insufficient.