Can't type Unicode because of keyboard shortcuts
I’m trying to type some Unicode characters that contain letters. I am using Windows 7 but the issue also appears in Windows 8. An example is 🎻 (U+1F3BB). I can’t type it though because Firefox and every other program I try to type them in has Alt+F or Alt+B as a shortcut for something else.
Is there anyway I can work around these shortcuts? I’ve tried Alt+Shift+(code) and editing the registry.
Solution 1:
The input method you seem to be using is the “universal” method on the Fileformat.info page How to enter Unicode characters in Microsoft Windows: press down Alt, enter + using the num keypad key, type the Unicode number in hexadecimal digits, release the Alt. Though very useful, the method isn’t really universal. First, it requires a Windows registry setting, which is usually off by default; but you have apparently this setting OK. Second, typing a character with Alt pressed down may get handled by the software you are using. Apparently in your version of Firefox, AltF gets handled by the browser. But even if you could fix this, it would not help you to enter U+1F3BB. The reason is the third essential limitation of the “universal” method: it works only up to U+FFFF, i.e. for characters in the Basic Multilingual Plane (BMP). Many new icon-like characters have been allocated outside the BMP.
Regarding the clash with shortcut assignments, it seems that using the Shift key together with the Alt key solves the problem. That is, press both Shift and Alt down when starting and keep them both pressed down until you have typed the hex digits. Tested in Firefox 84 in Win 10. Also works in Chrome
The BMP restriction is exemplified by the observation in comments: trying to enter U+10400 using the method results in Ѐ, which is Cyrillic letter Е with grave, U+0400. So when you typed 10400 in trying to use the method, the leading 1 was ignored. (In other words, the hex number entered was taken modulo 10000 hex.)
However, as phuclv’s answer tells, you can enter a non-BMP character as a surrogate pair. You would need to consult resources like Fileformat.info to find out the surrogate values (or tediously compute them).
For typing non-BMP characters, copy and paste is often the most practical way. Of course, you first need something to copy; you could use online tables of characters, or my Full Unicode Input utility, or the character picker in Microsoft Word (which extends past BMP, unlike the Windows character picker, i.e. CharMap).
Solution 2:
As mentioned in the other answer, you must press numpad + after Alt if you want to enter characters with hex values. Typically in that case the Alt+letter will be blocked from activating the menu in most apps. However Firefox and some others may choose to capture keyboard events differently so the behavior will be different. See How to prevent Firefox keyboard shortcuts from interfering with Unicode input?
For non-BMP characters you need to type using surrogate pairs because Windows always uses UTF-16. For example U+1F3BB is represented in UTF-16 as U+D83C U+DFBB, so you must type it as Alt++D83C then Alt++DFBB. You can use tools like https://r12a.github.io/app-conversion/ to get the surrogate pair. Or use PowerShell
PS /home> $c = [char]::ConvertFromUtf32(0x1F3BB) PS /home> "U+{0:X4} U+{1:X4}" -f [uint]$c[0], [uint]$c[1] U+D83C U+DFBB
That said, there are other built-in ways to enter any Unicode characters in Windows, even ones outside the BMP
-
Open Wordpad, enter the hex code point value (like 1F3BB) with an optional
U+
prefix and press Alt+X. This shortcut also works in MS Word and Libre Office -
Use the browser. You can use the JavaScript copy function to copy the desired characters to clipboard. It works in most modern browsers like Firefox, Chrome/Chromium (including Chromium Edge)
copy("\u25A0") // only applicable for characters in the BMP (⩽ U+FFFF) copy("\u{1F3BB}") // applicable for all characters (U+0000 to U+10FFFF) copy(String.fromCodePoint(0x1F3BB))
-
Use PowerShell and type the character directly, or copy it to clipboard
Add-Type -AssemblyName System.Windows.Forms [Windows.Forms.Clipboard]::SetText("`u{1F3BB}") # or [Windows.Forms.Clipboard]::SetText([char]::ConvertFromUtf32(0x1F3BB))
For newer versions of PowerShell you can just run
scb "`u{1F3BB}" # or Set-Clipboard "`u{1F3BB}" # or [char]::ConvertFromUtf32(0x1F3BB) | Set-Clipboard # or [char]::ConvertFromUtf32(0x1F3BB) | scb # or [char]0x1F3BB | Set-Clipboard
Another alternative:
[char]::ConvertFromUtf32(0x1F3BB) | clip "`u{1F3BB}" | clip
After this paste the character anywhere you want
There are also other ways in Windows without any 3rd party tools, like typing with VBS or Js but they're clunkier
That said, most of the time you should use the emoji panel instead. This works for emojis and lots of common symbols and is very quick and easy to use. There's no need to remember the Unicode code points anymore. Just press Windows+. (period) or Windows+; (semicolon) and type to search
See How do I bring up the emoji IME on Windows 10?