8

The key "5" at the standard keyboard numpad ("keypad" in XFree86) is named KP_Begin in XFree86 and VK_CLEAR in Windows virtual key space. What are these names originated in? Are they related each to other?

(There are mentions of "Clear" function for e.g. 3270 emulation but this function is by default mapped to Pause, not to numpad 5. Seems not related. The same for Mac Clear key.)

7
  • It's as well used as clear in some SUN Java classes. Also it's only mapped to VK_CLAR when not NUMLOCKed. So essentially what an early PC keyboard (Pre-AT) with dedicated cursor/function and numpad will deliver if the corresponding from the middle cursor/function key.
    – Raffzahn
    Dec 4 '21 at 20:04
  • 2
    Maybe Windows calls it "clear", because there is nothing printed (the key cap is clear) where the direction (up, down, home, ...) would be. Dec 4 '21 at 20:45
  • 1
    Adding an explanatory remark to Raffzahn's comment, an example of the relevant keyboard would be an IBM 122-key keyboard, such as that used on the 5250 terminal, which predates the IBM PC. This had five cursor keys in total - the four usual directional keys, plus a middle key located centrally between the four directional keys (just as they are now laid out on the numpad). A variety of keyboards existed in the past, and the Windows VK namespace accomodates many keys found on older IBM technology that have no independent existence on a modern keyboard (for example, the function keys 13-24).
    – Steve
    Dec 4 '21 at 22:07
  • 1
    Clarification about its use in Java. In input-edit routines VK_CLEAR is tied to clearing the field fron all content.
    – Raffzahn
    Dec 4 '21 at 22:35
  • 2
    Raymond Chen speculates (devblogs.microsoft.com/oldnewthing/20080211-00/?p=23503, better formatting: bytepointer.com/resources/old_new_thing/…) that VK_CLEAR and some of the other obscure Windows key codes originate from compatibility (planned and existing) with other architectures, such as the NEC PC-98, and other popular keyboard layouts. (This jives with @Steve's comment.)
    – Jim Nelson
    Dec 5 '21 at 0:41
9

VK_CLEAR has been present in Windows headers since Windows 1 (it's listed on page 57 of the Windows 1.03 SDK documentation, for example).

Windows 1 could run on, among other computers, the Apricot PC, Xi and Xen. These computers had a dedicated Clear key, and so it is possible that the VK_CLEAR code was created to support the keyboards on these computers. Once Windows supported VK_CLEAR, it would be reasonable enough to map an otherwise unmapped key on the PC / XT / AT keyboards to it.

Looking in windows.h (WinUser.H in 32-bit SDKs), VK_CLEAR is defined as 0x0C. This is part of a group with VK_BACK = 0x08, VK_TAB = 0x09 and VK_RETURN = 0x0D. That suggests an intended association of VK_CLEAR with the ASCII 'form feed' character, Ctrl+L, which often clears the screen in terminals and terminal emulators.

1
  • 2
    Or to be more clear (SCNR), FormFeed was the clear screen code on glass-tty, the earliest form of CRT based terminals.
    – Raffzahn
    Dec 5 '21 at 23:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.