Window Cursor LOCK


Would it be possible to create a way to lock the cursor in a window? when playing games in windows mode I don't know why but in Mac it always gets out of the window, it happens in league of legends and some other frenetic games!

Please would be so useful!