A third method for entering Unicode characters from the keyboard (when you know the hex code)

Posted: (EET/GMT+2)

 

If you have ever needed to input a special character in Windows, you've most probably used the Alt+keycode input method. This works by holding down the Alt key, and then typing in either a three-digit or four-digit character code in decimal from the numeric keypad. For instance, to type in the copyright sign, press Alt+0169 from the numeric keypad (on many laptops, this requires the NumLock to be on).

Typing four digits after the Alt key instructs Windows to enter the character corresponding to the character code in Windows' own code page, subject to regional settings. Entering a three-digit code refers directly to your OEM code page, which might give different results from the four-digit codes. Both numeric values refer to decimal codes.

However, there's also a third Unicode character entering option which allows you to enter Unicode code points (character codes) from keyboard using their hex code. For this method to work, you need to enable a registry setting as follows:

HKEY_Current_User\Control Panel\Input Method\EnableHexNumpad

Add the "EnableHexNumpad" value with the value of "1" (type is REG_SZ). You need to reboot the computer for this setting to take effect.

Once this registry key is in place, you can type in characters based on their Unicode code point in hex. For example, to type in the character "Latin L with middle dot", hex code 013F, type in as follows:

Hold down the Alt key, press the plus sign on the numeric keyboard (keypad), and then type in hex code either using the numbers in the numeric keypad or the regular number keys. Finally, release the Alt key. You can easily practice this in for example Notepad. The character should look like this: Ŀ.

To find a list of Unicode characters, go to the official Unicode standard page. You can also find a listing of characters on WikiBooks.

It's hard to find official documentation on this, but I managed to find at least one old glossary page from MSDN that mentions this third method under the "Alt+Numpad" entry. Here's a copy of the text, in case the page does get removed:

"Alt+Numpad: A method of entering characters by typing in the character's decimal code with the Numeric Pad keys (Num Lock turned on). In Windows:

  • Alt+xxx, where xxx is the decimal value of a code point, generates an OEM-encoded character.
  • Alt+0xxx, where xxx is the decimal value of a code point, generates a Windows-encoded character.
  • Alt+ + +xxxx, where xxxx is the hexadecimal Unicode code point, generates a Unicode-encoded (UTF-16) character.

Happy keyboardin'!