SEARCH

How-To Geek

Insert Any Special Character with a Single Keystroke

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.

image

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.

SNAGHTML24db69d

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.

SNAGHTML25121cc

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.

image

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.

image

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.

image

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.

image

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.

Cent:

Euro:

Registered Trademark:

Copyright:

ñ:

!c::
{
SendInput {¢}
}
return
!e::
{
SendInput {€}
}
return
!r::
{
SendInput {®}
}
return
!p::
{
SendInput {©}
}
return
!n::
{
SendInput {ñ}
}
return

Conclusion

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.

Link

Download AutoHotkey

Matthew digs up tasty bytes about Windows, Virtualization, and the cloud, and serves them up for all to enjoy!

  • Published 07/6/10

Comments (13)

  1. J

    Most of my symbol inserting needs are in words equation editor. Which is why I’ve created a keyboard shortcut for insert equation as Ctrl+Alt+Q (Word Options > Customize > Keyboad shortcuts: Customize > Insert tab, EquationInsert).

    Words equation editor understands lots of latex commands, i.e. \omgea becomes ω, \Omega becomes Ω, etc. If you check “” under Equation Tools,Design,Tools,Equation Options > Math AutoCorrect

  2. Matthew Guay

    @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.

  3. J

    There is actually similar functions built in to word. I realize that the above tip works in all programs, but it’s a rather tiresome method if you utilize large parts of the greek alphabet.

    Most of my symbol inserting needs are in words equation editor. Which is why I’ve created a keyboard shortcut for insert equation as Ctrl+Alt+Q (Word Options > Customize > Keyboad shortcuts: Customize > Insert tab, EquationInsert).

    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!

  4. Doc

    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.

  5. Matthew Guay

    @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.

  6. Az

    this method only works with character in in unicode, I’ve been trying with the others, such as pi, with no success! Any one has a fix? Using the Alt+Numpad code as a bridge maybe?

  7. Chad Underwood

    This just made my life easier. AHK is one of the greatest freeware programs ever!

  8. Anonymous

    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.

  9. Katy

    Thank you! Just what I needed. Simple, easy, clearly instructed. Great!

  10. Vlad

    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):

    ;A cu trema
    >!a::
    {
    SendEvent {U+00E4}
    }
    return
    +>!a::
    {
    SendEvent {U+00C4}
    }
    return

    ;E cu trema
    >!e::
    {
    SendEvent {U+00EB}
    }
    return
    +>!e::
    {
    SendEvent {U+00CB}
    }
    return

    ;I cu trema
    >!i::
    {
    SendEvent {U+00EF}
    }
    return
    +>!i::
    {
    SendEvent {U+00CF}
    }
    return

    ;U cu trema
    >!u::
    {
    SendEvent {U+00FC}
    }
    return
    +>!u::
    {
    SendEvent {U+00DC}
    }
    return

    ;O cu trema
    >!o::
    {
    SendEvent {U+00F6}
    }
    return
    +>!o::
    {
    SendEvent {U+00D6}
    }
    return

    ;S
    >!s::
    {
    SendEvent {U+00DF}
    }
    return
    +>!s::
    {
    SendEvent {U+00A7}
    }
    return

    so, pressing right alt+u will result in ü, right alt +s results in ß, so forth. Hope this saves somebody an hour of googling.

  11. Mark

    How do I do this character: ʁ. It’s Unicode. I just can’t get it to work.

  12. Mark

    I’ve tried

    !r::
    {
    SendEvent {U+0281}
    }
    return

    No luck

  13. Anti-widescreen

    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.

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!