try to put var mouse_mode = 2;
at the end of your code,

this activates the mousepointer and deactivates mouse_force inputs,

But I dont know how this works with the templates.