I don’t play a lot of games, but for when I do, I’d just like to know if there is, and what it is if it’s there, a way to lock the mouse cursor on the game’s screen when playing a STEAM game, so that it isn’t able to cross the border to my secondary screen.
It is probably a minor thing and very unnecessary, but when I do play a game I find myself constantly going over the border to the secondary screen. And that can be quite annoying.
I’m not sure how to tell where to look I don’t know what game you have issue with, and I don’t know every games menus either but that should be in the video setting, where you can change resolution and other graphic settings, you should be able to tick a box for fullscreen, or select in a list in between other options like windowed/borderless/fullscreen. Globally it is in video/graphics settings.
Maybe there is some Linux tool to do exactly that, lock your mouse on specific screen, I saw threads where people were doing that on Windows so you can maybe look into that option now?
I managed it. And I must admit, I am actually rather proud of the way I did it.
I couldn’t find any way to do it. So I rolled my own. Mainly using XRandR, but there is more than just that.
In the end I wrote a custom little script to:
Turn off my KDE composition. If I didn’t turn it off, It’s get turned off by steam and I wouldn’t be able to turn it on afterwards without going to the GUI “System settings” controller. This was done with qdbus.
Switch off, or disable my secondary monitor, so that only the primary is being used. This was done with xrandr.
Launch steam, but enqueue the following to run when it closes
3.1. Enabling my secondary monitor using xrandr again.
3.2. Enabling the composition I disabled previously.
This might not seem like a big deal, but I am actually rather proud of it.
Short and sweet. I realize I can leave the check for the compositing out, but I’m leaving it in for the moment since it’s not hurting anyone.
UPDATE:
Have done exactly that, as well as try and make the script a bit more readable. So far, all seems well. The updated script for those interested:
I realised the disabling and re-enabling of the compositor this way was causing problems. Sometimes it would work and sometimes not.
Whenever the game exited, the compositor would be off and I’d get a popup I can turn it on by pressing Alt+Shift+F12. So I searched the net for some way to use the command line to send key presses.
Enter xdotool. So I changed the script to check if the compositor is active when Steam has exited and if not, “press” the key combination to enable it. It seems to work. For now, anyway.