I've found the solution on Chinese Ubuntu forums on http://forum.ubuntu.org.cn/viewtopic.php?p=479741&sid=c37de1d11989db6ebe95227b35efa770#479818 , which say sudo apt-get install scim-bridge sudo gedit /etc/X11/xinit/xinput.d/scim change GTK_IM_MODULE=xim into GTK_IM_MODULE="scim-bridge" and restart X. This fixed the problem (both deadkey and SCIM) for me.
I've found the solution on Chinese Ubuntu forums on http:// forum.ubuntu. org.cn/ viewtopic. php?p=479741& sid=c37de1d1198 9db6ebe95227b35 efa770# 479818 , xinit/xinput. d/scim MODULE= "scim-bridge"
which say
sudo apt-get install scim-bridge
sudo gedit /etc/X11/
change GTK_IM_MODULE=xim into GTK_IM_
and restart X.
This fixed the problem (both deadkey and SCIM) for me.