RSS

How-To Geek

Have you ever tried to insert a special character such as the cent sign or the copyright symbol, only to realize that this key isn’t available on your normal keyboard? Here’s how you can make an AutoHotkey script that will let you easily insert any character you want.

The Problem

Special characters can often be annoying to use. There are many different ways to insert special characters, and many programs have specific ways to insert them. For example, in Microsoft Word you can insert a special character from the Symbol button on the Insert tab in the ribbon.

Word also has specialized keyboard shortcuts for many of the common special characters. For example, you can insert the Registered Trademark symbol ® by pressing Alt+Ctrl+R.

That’s a rather unwieldy shortcut, but it’s better than the default Windows shortcut for that symbol. If you open the Character Map and select the Registered Trademark symbol, you’ll see that you could enter the ® symbol by pressing Alt+0174. Now that’s a difficult shortcut to remember.

The Solution

Thanks to AutoHotkey, we can solve this problem and make our own keyboard shortcuts for our favorite symbols. AutoHotkey is a great tool that we frequently mention here, but if you don’t already have it installed, download it at the link below and setup as normal.

Once AutoHotkey is running, you can right-click it’s icon in the tray and select Edit This Script to add your special character shortcut to your script.

Adding a Special Character Hotkey

Here’s what you need to enter in your AutoHotkey script to create a shortcut for your special character. This will let you press Alt+ the character of your choice to enter a special character. Substitute your_hotkey with the character you want to use as your shortcut, and your_special_character with the special character you want to input.:

!your_hotkey::{SendInput {your_special_character}}return

To find the special character you need to enter, open the Character Map in Windows, find the character, and then select Copy. Now paste this instead of Your_special_character.

For Example, we want to enter the degrees symbol by pressing Alt+o. So, we entered the following in AutoHotkey:

!o::{SendInput {°}}return

Press Save in Notepad, and then reload the AutoHotkey script from the taskbar.

Now, we can simply press Alt+o to enter °. Entering the temperature just got easier!

You can substitute ! for ^ if you’d like to use Ctrl instead of Alt for your shortcuts. Note also that many programs have keyboard shortcuts using Ctrl and Alt, and even many default Windows shortcuts such as Cut and Paste use Ctrl, so make sure to not make a shortcut that overrides these.

Here’s some scripts for common special characters we wanted to use this with. Note that you can have as many of these in one script file as you like.

Whether you’re trying to enter a character from another language or simply need to make sure you show that your product name is copyrighted every time you right it, this simple trick will help you find and enter what you need quicker. Although it may take a minute to setup, once it’s done you can simply leave it and just remember your new shortcut. If you find that your shortcut interacts with another program, you can also easily change it anytime.

@J – Thanks for sharing these shortcuts; I was not aware of those Equation Editor shortcuts. The great thing with the method I shared above is that you can use the shortcut to insert special characters in any application, including an online form such as the comment box on our site.

Words equation editor understands lots of latex commands, i.e. \omgea becomes ω, \Omega becomes Ω, etc. If you check “Use Math AutoCorrect rules outside of math regions” under Equation Tools,Design,Tools,Equation Options > Math AutoCorrect, these latex commands also work outside of the equation editor. Under Math AutoCorrect you can also assign your own commands. For example I’ve changed the default epsilon ϵ, to one that’s more frequently used at my school, ε. I’ve also added a few others like \yields ⟹, and \dot ⋅.

Next to the Math AutoCorrect button is a button labeled Recognized Functions. This function converts i.e. sin and cos to italicized text and creates a little box next to them. I decided to remove max and min from recognized functions because I often use those expressions as indexes without utilizing the resulting box.

It’s surprising how few who knows about these features. It’s really helpful for an engineering student like myself. I haven’t found any decent guides on the topic so I always end up explaining each step for my fellow students instead of just sending them a link. So I would be most grateful you guys could write an article about it, maybe you’ll even be able to teach me a trick or two!

You neglected to say that you can combine ! with ^ to get a CTRL-ALT-key shortcut, use + for SHIFT, and also use # for the “Windows” (“Super” to Linux geeks) key, which can also be combined: ^!+#Q:: { SendInput {Quiet!}} return will enter “Quiet!” when you hit CTRL+ALT+SHIFT+WIN.

@Doc – Ah, good point. I was trying to show how to make the easiest keyboard shortcut possible, but one good reason to use multiple keys such as Ctrl+Alt+whatever would be to keep from overriding other programs’ default keyboard shortcuts.

Az: Pi is in Unicode, in the section with all the other Greek characters. It is not in ANSI, so it doesn’t have a standard Alt+Numpad code. The uppercase Pi Π is Unicode 03A0, and the common lowercase Pi π is Unicode 03C0.

For anybody trying to insert special characters: You may fail by using this method. A better way I discovered is to use the SendEvent {U+xxxx}, where xxxx is the hex code of the character you want to send. I have devised a script which inserts the most common german characters(comments in romanian):

You can type any Unicode character in Windows with Alt+####, where #### is the four- or five-digit decimal code point of the character. You can use the Windows caluclator to convert the hexadecimal U+#### numbers into decimal values to get the keystrokes. I keep a short list of the ones I use most frequently.

In Word, you can also go to File>Options>Proofing>AutoCorrect and set a particular sequence of ASCII characters to be replaced by a Unicode character. For example <= for ≤ or != for ≠ or +- for ±. This is a good feature and can save hundreds of trips to the Character Map.
Another method, although it may be time consuming is to use Microsoft Keyboard Layout Creator (MSKLC). MS offers it for free download at "http://msdn.microsoft.com/en-us/goglobal/bb964665&quot;. It may be very effective, especially if you are using multiple computers. However, keep in mind that dead keys, SGCaps (A different set of symbols when Caps-lock is on instead of all capitals), and multiple characters, cannot be combined. Be careful because the UI will let you define them and they will work in MSKLC's test utility, but they will not work when you install the keyboard layout. This is very nice but unfortunately it takes a while to produce a keyboard layout. I use SGCaps for Greek letters and other Math symbols that I use frequently, so when I need to type something like Σ, π, ∫, ∞, Π, ≠, ≈, ±, σ, ε, etc. I just turn on Caps Lock. It's very convenient.

DID YOU KNOW?

Water intoxication is a potentially fatal disturbance in brain functions wherein someone has consumed so much water that their electrolytes are thrown dangerously out of balance; outside of extreme instances like water-drinking contests or drinking large amounts of water while exercising for long periods of time, water intoxication is very rare.