I just bought a 60% keyboard, which lacks a dedicated "`~" key next to the "1" key. In brazilian portuguese it's very common to use characters such as "ã" or "õ". For those who don't know, here's how a 60% keyboard looks like:
I'm able to type such characters by setting my layout to "English International".
Problem is, typing ~ in this keyboard requires the simultaneous pressing of Fn+Shift+Esc and then either "a" or "o" in my examples, before it prints the character I need.
This is a phenomenal amount of work for such common characters.
In Windows, I installed Autohotkey and made a small script which is used to input "~" when I press Shift+Esc. It works flawlessly as expected, and I'm able to remove the Fn key out of the keychain I have to press to type those characters.
I tried to do the same in Linux Mint 18.1 (which is based on Ubuntu 16.04) by installing Autokey and mapping the same shortcut to "~".
It works too, but in this case, instead of waiting for the next keypress to print the character, it already prints ~, as if my layout was not set to English International (but it is). I'm 100% positive my layout is selected right, as it works when I use the full key combination with Fn.
My question is: how can I make a shortcut in Ubuntu 16.04 that works as it works in Windows with Autohotkey?
It can be a solution using either Autokey or something else, as long as it works.