Win32: http://msdn.microsoft.com/en-us/library/windows/desktop/ms64...
X11: http://tronche.com/gui/x/xlib/input/XWarpPointer.html
IIRC it isn't exposed to JS except maybe for some new fullscreen API (not my area, sorry.)