Archives

All posts for the month April, 2015

Finally, I have a little thing to write about.

As I am learning Turkish I have to regularly write letters (or characters) that are part of the Turkish alphabet, but are not present in my preferred keyboard layout (in my case German).

In Turkish these letters are:  ş Ş ğ Ğ ç Ç ı İ

So I was looking for convenient solutions to easily and fluently write these letters and stumbled upon AutoHotkey, which is a quite extensive tool which lets you do a lot of stuff. Among other things you can create new key mappings, or overwrite your current keys. You can even say: “Every time I write ‘hlelo’ auto correct to ‘hello’.”.

As I said, it’s quite extensive, but that’s not the reason we’re here.

In my case I wanted to map the Turkish characters on [ALT GR] + <Letter>, for example:

[ALT GR] + [G] will turn to ğ

[ALT GR]+ [I] will turn to ı

[ALT GR] + [SHIFT] + [I] will turn to İ

You get the idea.

In order to do this, we will create an AutoHotkey file (*.ahk), which we can access when we run AutoHotkey, right click on the tray icon (in the lower left corner in Windows), and select “Edit This Script“. Here we can use some code to do our bidding.

In this particular case we can use the following code, where the + stands for [SHIFT], the <^> stands for [ALT GR], and the s for… well, [S]. We then tell the program to send the letter Ş if this particular combination occurs and let it return to its usual duties.

+<^>!s::
{
  Send {Ş}
  return
}

If we want to do the same for the smaller case character, we simply remove the +, as you can see here:

<^>!i::
{
  Send {ı}
  return
}

It is important to note that the configuration file has to be saved using a Unicode compliant encoding, for example UTF-8. The Windows Notepad is able to do that, if you select “Encoding: UTF-8” in the “Save As” dialog.

After saving the file, you might have to select “Reload This Script” in AutoHotkey, to make it uses the new version.

You can find the whole file with Turkish characters and Scandinavian characters (with bindings a-å, ä-æ and ö-ø) here: http://pastebin.com/s8u21Ftt

Please note that the bindings might make more sense on different keys, depending on your default keyboard layout.

I hope this helps someone at some point.

PS: I don’t do April Fools’ Day!