Locking Cursor to be able to play games

Hi, I have a question about locking the cursor for playing games.

For instance, I'm trying to control my PC (Windows 11) and play games remotely. The host's computer's mouse locks, while the other computer I'm using doesn't lock. It seems there’s no way to lock the cursor in place. I understand that TeamViewer isn't primarily designed for gaming, but it's the best option I have right now. I don't know if there is a way or setting to make this possible, but it would be a good addition.