Grouping keys, how are "International" and "Lang" keys used?

I’m creating a (hopefully) broadly useful header file with some constexpr functions that can be used to determine which of several “groups” a key is in (in my case, for purposes of coloring them all at the same time).

I’m basing this on the mappings from HIDTables.h and it will have most of the keys that would be used, with a few exceptions that are likely to be individually colored, like space, backspace, enter, tab, and esc.

The groups I’ve come up with are

  • Alpha
  • Number
  • Punctuation (including brackets & slashes)
  • Function (F1-F24)
  • Navigation (Insert, Delete, Home, End, PageUp, PageDown)
  • Arrow
  • Keypad (which has a lot of weird keys you don’t often see)
  • Media (play, stop, volume, eject, and some of the other consumer keys)
  • Modifier (shift, control, alt, Gui/Cmd, app/menu)
  • International - the keys labeled International1-9 and Lang1-9

Since I am an English speaking Canadian, I guess I don’t qualify as “International”, but I was wondering if someone more familiar with the USB HID spec can tell me what the International1-9 and Lang1-9 keys are. Are these like the ones used, for example, on German and Norwegian keyboards for accented characters or letters that aren’t used in English?

If that is the case, should these just get grouped in with the Alpha keys, or does it make sense to have a separate group for these? Or are these just some super obscure thing that isn’t really used in practice?

Any information that can clear this up for me and help me make this a more useful header file would be appreciated. I’m willing to share implementation details if anyone is interested or wants to debate what the groupings of keys should be.

To at least partly answer my own question, it seems that most accented characters in European languages and such are just the regular punctuation or letter scancodes, so they are not those International/Lang keys.

I did find the documentation from the USB Implemeters’ Forum

All that I could really glean from that is the following:

Keyboard International1 should be identified via footnote as the appropriate usage for the Brazilian forward-slash (/) and question-mark (?) key. This usage should also be renamed to either “Keyboard Non-US / and ?” or to “Keyboard International1” now that it’s become clear that it does not only apply to Kanji keyboards anymore.

There doesn’t appear to be any notes about the other Keyboard International keys.

Keyboard Lang1 — Hangul/English toggle key. This usage is used as an input method editor control key on a Korean language keyboard.
Keyboard Lang2 — Hanja conversion key. This usage is used as an input method editor control key on a Korean language keyboard.

Keyboard Lang3 —Defines the Katakana key for Japanese USB word-processing keyboards.
Keyboard Lang4 —Defines the Hiragana key for Japanese USB word-processing keyboards.
Keyboard Lang5 —Usage 0x94 (Keyboard LANG5) "Defines the Zenkaku/Hankaku key for Japanese USB word-processing keyboards.
Keyboard Lang6-9 —Reserved for language-specific functions, such as Front End Processors and Input Method Editors.

So… Lang keys are used for switching input methods, languages, or characters in Asian languages and one of the International keys is used in Brazilian for a slash for some reason (I’m not sure what was wrong with the normal /? key). It seems that the International keys won’t likely get much use, and maybe that International 1 should be grouped with Punctuation for the benefit of any Brazilians.

They reused that key in their keymap for other glyphs, and it seems that there are at least two major variations on which glyphs. In one variation the ‘/’ and ‘?’ key has ‘;’ and ‘:’, because ‘ç’ and ‘Ç’ are on that key, with ‘;’ and ‘:’ elsewhere displacing other glyphs.

I see. Thanks for the info!