I had an issue where touchpad used to mess around change my focus, so i used following commands as startup script to disable touchpad when I am typing
# disable touch pad for one second, when keyboard is in use
# add this as a startup command to presist it across reboots
syndaemon -i 1