Select "Lock Mouse Cursor to Current Monitor" or create a custom function to lock the cursor to your main display. Assign a hotkey (e.g., Ctrl + Alt + L) to quickly toggle the mouse lock on and off when gaming. Press the hotkey to lock the mouse cursor to your primary monitor before starting the game. More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.