usage

package module
v1.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2022 License: MIT Imports: 0 Imported by: 2

README

hid.usage

Go Reference

Implements usage page and usage ID uint16->string mapping specified in HID Usage Tables version 1.3 ( https://www.usb.org/hid )

Usage

Provides three functions:

  • Page(page uint16) string for getting name of the usage page.
  • Id(page, usage uint16) string for getting name of usage id on specific page
  • Get(page, usage uint16) (page, usage string) for getting both name and usage of specific page.

Issues & Contributing

Notes

  • Zero imports. Just hardcoded mapping based on the HID Usage Tables spec.
  • Missing Gaming Device (0x92) page usages as they're apparently separately owned by Gaming Standards Association and not listed on usb.org site.
  • To save some effort, "reserved" ranges haven't been included. Instead we'll just default to returning the '0x' prefixed uppercase representation of the value (e.g. 0xE3) whenever usage doesn't have specific name defined.
  • Might or might not be updated if a new HID Usage Tables version happens to comes out and I notice such thing happening.
  • Contributions are welcome if something bothers you.

Documentation

Overview

Implements mapping specified in HID Usage Tables version 1.3 ( https://www.usb.org/hid )

All product names are trademarks, registered trademarks, or service marks of their respective owners.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(page, usage uint16) (sPage, sUsage string)

Get returns names of both page and ID as listed in the official HID Usage Table spec

func Id

func Id(page, usage uint16) (s string)

Id returns Usage ID name listed in the official HID Usage Table spec

func Page

func Page(page uint16) (s string)

Page returns Usage Page name listed in the official HID Usage Table spec

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL