Hey! This script is quite useful, but it wasn't working for codes that contained zeros. I've noticed that the Ctrl+Shift was only necessary while typing the "u" character. Also, the composition stops if the 4th hexadecimal character is a letter and the space character was inserted. The composition doesn't stop (and typing space is needed) when the 4th hexadecimal character is a digit. I've replaced typing space with another Shift keystroke and it works fine now. Here's the updated function:
Update: I noticed letters wouldn't get typed for the code, because Shift was up and the hexadecimals need to be uppercase. I updated the script so that only Ctrl gets released after U and Shift gets released at the end. Works like a charm.
Code:
SendUnicode( UniHex )
{
; difference between GTK+ applications and all other Windows applications
IfWinActive ahk_class gdkWindowToplevel
SendInput, {Ctrl down}{Shift down}u{Ctrl up}%UniHex%{Shift up}
Else
SendInput, {U+%UniHex%}
}