1

I was wondering if there is any difference between undefined and unassigned virtual key codes and if there is any known reason of why they're seemingly spread randomly in the numeric sequence rather than grouped together for example at the end.

Is it that the unassigned have been declared (just not assigned a value) while the undefined haven't? If so, what are they declared as? I believe the reserved ones are for possible future use, correct me if I'm wrong.

user7393973
  • 2,270
  • 1
  • 20
  • 58
  • I'm not too sure if this is a valid question for the site. It is small but I don't have anything else to add to it and it's also not opinion based. – user7393973 Oct 22 '19 at 15:31
  • 1
    Interesting question, I checked a web page from 2006 via webarchive and it seems after 13 years still same key codes are unassigned and undefined. https://web.archive.org/web/20060202030330/https://api.farmanager.com/en/winapi/virtualkeycodes.html – unlut Oct 22 '19 at 15:46
  • 3
    This goes back before Oct 1986, Windows version 1.0 already had these definitions. Too long ago to be sure, this *probably* affects what an OEM keyboard manufacturer can do when they add keys to their layout. They can choose an "undefined" number for their custom key but not a "reserved" one. This must not in any way affect what code you write. – Hans Passant Oct 22 '19 at 16:02
  • 1
    I think there is no difference (at least if there was at a point in time, there is no more), because the documentation link in your question shows 0x16 as undefined, however in winuser.h 0x16 is specified as "unassigned" https://github.com/tpn/winsdk-10/blob/master/Include/10.0.10240.0/um/WinUser.h. Also notice that there is no such a thing as "undefined" in winuser.h, just unassigned. – unlut Oct 23 '19 at 07:18

0 Answers0