title: How to convert between keyboard scan code and USB keyboard usage index?
body: <p>I'm working with a Windows virtual keyboard driver to generate keystrokes, and it requires specifying keys using the USB keyboard usage index. (See <a href="https://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc" rel="nofollow noreferrer">&quot;Windows Platform Design Notes - Keyboard Scan Code Specification&quot;</a> appendix C for a list of usage indices and corresponding keys.) However, the keys I need to type will be specified by virtual key code.</p>
  <p>Windows provides functions for converting between virtual key codes and scan codes, but I haven't found any way of converting between scan codes and these usage indices. Other than writing my own function that converts the hundred-and-change possible scan codes that my virtual keyboard driver may need to type, does Microsoft provide a function for doing this?</p>