A tutorial that explains how to lock the cursor and enable raw mouse input for X11, WinAPI, Cocoa, and Emscripten. Introduction RGFW is a lightweight single-header windowing library, its source code can be found here. This tutorial is based on its source code. When you create an application that locks the cursor, such as a game with a first-person camera, it's important to be able to disable the cursor. This means locking the cursor in the middle of the screen and getting raw input.