Diving in the Internet I found some answers, mainly related with IBus. However, it seems like they are not working with elementary OS 0.4 Loki.
The workaround is simple, just edit the file of the launcher corresponding to Telegram:
and change this line:
Exec=/home/YOUR-USER/Downloads/Telegram/Telegram -- %u
to look like this other one:
Exec=env QT_IM_MODULE=xim /home/YOUR-USER/Downloads/Telegram/Telegram -- %u
That should do the trick. But maybe you need to install a couple of IBus dependencies first? Just in case:
sudo apt install ibus-gtk ibus-gtk3 ibus-qt4
Elementary OS Freya. Simple. Elegant. But there is still some things I miss, like the option to open a folder or a file with root permissions from the file explorer. With these easy steps this issue can be easily solved:
1.- Install gksu in order to be able to prompt for superuser permissions from the window manager.
sudo apt-get install gksu
2.- Create the “open folder as root” contractor.
sudo touch /usr/share/contractor/folder-openasroot.contract && gksudo scratch-text-editor /usr/share/contractor/folder-openasroot.contract
3.- Add this to the contractor:
Name=Open folder as root
Description=Open current folder as root privilege
Exec=gksudo pantheon-files %U
4.- Create the “open file as root” contractor.
sudo touch /usr/share/contractor/file-openasroot.contract && gksudo scratch-text-editor /usr/share/contractor/file-openasroot.contract
5.- Add this code to the contractor:
Name=Open file as root
Description=open file as root with scratch
Exec=gksudo scratch-text-editor %U