Workaround for broken mouse click functionality when debugging Factorio in a mouse event

Tools which are useful for mod development.
sparr
Smart Inserter
Smart Inserter
Posts: 1444
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Workaround for broken mouse click functionality when debugging Factorio in a mouse event

Post by sparr »

I was using the modding toolkit debugger with a breakpoint that triggered when I clicked on something in-game. This left my mouse clicks captured by factorio, so I couldn't click on anything anywhere else while other mouse and keyboard functionality worked fine.

https://unix.stackexchange.com/a/62252/2434 led me to `xdotool key "XF86LogGrabInfo"` which puts a list of active and registered input grabs into `Xorg.0.log`, where I found factorio with the sole grab and a mask for clicks.

https://unix.stackexchange.com/a/40472/2434 led me to `setxkbmap -option grab:break_actions; xdotool key XF86Ungrab` to release the grab!
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 579
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: Workaround for broken mouse click functionality when debugging Factorio in a mouse event

Post by raiguard »

Version 1.1.95 features a new hidden setting disable-mouse-auto-capture that will prevent this issue.
Don't forget, you're here forever.
justarandomgeek
Filter Inserter
Filter Inserter
Posts: 302
Joined: Fri Mar 18, 2016 4:34 pm
Contact:

Re: Workaround for broken mouse click functionality when debugging Factorio in a mouse event

Post by justarandomgeek »

If anyone has any suggestions for how I can detect, from the debugger (in TS), that this has occurred (or is likely to occur in a given environment), i can also offer to set the setting for the future.
Post Reply

Return to “Development tools”