USB HID USAGE page

I am working on the USB HID devices. I have downloaded the HID tool from the http://www.usb.org link. I have question that while making the mouse or keyboard some times we use the generic desktop as a usage page and sometimes not. also what is usage max and usage min.
what is the actual need of this generic desktopp??
please do needful for this.
thanking you,
Sapna.

Parents
  • Usage Page

    The HID spec defines Usage Page as follows,

    5.5 Usages (HID1_11.pdf p17)
    A Usage is interpreted as a 32 bit unsigned value where the high order 16 bits
    defines the Usage Page and the low order 16 bits defines a Usage ID.
    Usage IDs are used to select individual Usage on a Usage Page.
    

    Usage Page and Usage (Usage ID) are pair.
    But as Usage Page is a global item, you don't need to attach it to every Usage.
    Once a Usage Page is declared, it takes effect to all Usage after it,
    until another Usage Page is declared.



    Usage Minimum and Usage Maximum

    You can declare Usages one by one, like

    Usage (Keyboard_LeftControl)
    Usage (Keyboard_LeftShift)
    Usage (Keyboard_LeftAlt)
    ...
    Usage (Keyboard_Right_GUI)
    

    But this method is too heavy for many Usages.
    For example, it's unrealistic to write down the Usage of each key for 101 keyboard.

    When the Usages are assigned to contiguous number, you can define all Usages with the first one (Usage Minimum) and the last one (Usage Maximum).

    Usage Minimum (Keyboard_LeftControl)
    Usage Maximum (Keyboard_Right_GUI)
    

    [Reference]
    The HID spec 1.1
    www.usb.org/.../HID1_11.pdf

    Tsuneo

Reply
  • Usage Page

    The HID spec defines Usage Page as follows,

    5.5 Usages (HID1_11.pdf p17)
    A Usage is interpreted as a 32 bit unsigned value where the high order 16 bits
    defines the Usage Page and the low order 16 bits defines a Usage ID.
    Usage IDs are used to select individual Usage on a Usage Page.
    

    Usage Page and Usage (Usage ID) are pair.
    But as Usage Page is a global item, you don't need to attach it to every Usage.
    Once a Usage Page is declared, it takes effect to all Usage after it,
    until another Usage Page is declared.



    Usage Minimum and Usage Maximum

    You can declare Usages one by one, like

    Usage (Keyboard_LeftControl)
    Usage (Keyboard_LeftShift)
    Usage (Keyboard_LeftAlt)
    ...
    Usage (Keyboard_Right_GUI)
    

    But this method is too heavy for many Usages.
    For example, it's unrealistic to write down the Usage of each key for 101 keyboard.

    When the Usages are assigned to contiguous number, you can define all Usages with the first one (Usage Minimum) and the last one (Usage Maximum).

    Usage Minimum (Keyboard_LeftControl)
    Usage Maximum (Keyboard_Right_GUI)
    

    [Reference]
    The HID spec 1.1
    www.usb.org/.../HID1_11.pdf

    Tsuneo

Children
More questions in this forum