How to use special characters on Windows without change keyboard language

David Hernández
Nov 5 · 3 min read

One year ago, I purchased a new laptop on the internet and I was unable to choose my keyboard language (not a big deal), I set up my new Windows with the ability to change my keyboard language using win+space.

I started using the English keyboard to work (it is very good to code), but I stilled using my Spanish keyboard to chat with friends and family since I was unable to input special characters like ¿ or á. This was a good solution at that time, but I always felt uncomfortable changing my keyboard language a lot of times during the day.

One year later, I reinstalled Windows (what a surprise eh) and I thought that it was a good moment to improve my day to day. So I did some research about how to extend my keyboard functionality to use both languages in one keyboard layout.

My research led me to Auto Hot Key

AutoHotkey is a free, open-source scripting language for Windows that allows users to easily create small to complex scripts for all kinds of tasks such as: form fillers, auto-clicking, macros, etc.

The main goal is to create a script that allows us to write special characters without a Spanish keyboard active.

Once AHK is installed, the first step is to create a new AHK script:

  1. Right-click on Desktop or any location.
  2. Choose new
  3. Click on AutoHotKey Script

Then we need to right-click on the new file and click on Edit script.

Now we will see some code on the script, we can delete it without a problem.

One of the main functionalities on AHK is to replace strings when we are typing, it is called hotstrings, for example, if we include this line

::btw::by the way

and run the script (right-click on the file — Run script) we will be able to type btw and when we press tab, we will get the by the way text on wherever program that we are using.

So, after some research, I found a way to simulate the way we type special characters like á, ñ, or ¿. I added some extra symbols and include all my needed special characters resulting in the following script

:?*:]n::ñ

:?*:]a::á

:?*:]e::é

:?*:]i::í

:?*:]o::ó

:?*:]u::ú

:?*:]?::¿

The ? symbol indicates that doesn’t matter what is before the hotstring and the * allows to fire the text replacement without press tab or enter. I choose ] as my prefix character to fire the script since is not very common to use the ] character before a letter, and because it feels familiar to me but you can choose any symbol you want.

When the script is running I’m able to input á typing ]a or ñ typing ]n.

IT WORKS!

Finally we can setup the script to run when the system starts.

  1. Press Windows + R and type

%appdata%\Microsoft\Windows\Start Menu\Programs\Startup

2. Create a shortcut to your script under the startup folder.

I hope this article helps another person using multiple keyboards layouts!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade