AutoHotkey: How to Define 2 Alphabet Keys as Hotkey

AutoHotkey allows user to define a custom combination of two keys (except joystick buttons) by using ampersand (&) between them. As for example:

a & b::MsgBox Hello!!!

Hold down <a> key then press <b> key to trigger the message box.

But by using this way, key <a> will become a prefix key. In other words, it will causes key <a> to lose its original function when it is pressed, i.e. “a” will not appear in text box. To avoid this behaviour, one of the way is to apply the tilde prefix (~) to the key.

For example:

~a & b::MsgBox Hello!!!

Using tilde in front of keys will maintain the native function of the keys used. However, Special hotkeys that are substitutes for alt-tab always ignore the tilde prefix.