crgimenes / neko

Neko is a cross-platform cursor-chasing cat. This is the reimplementation write in Go.
BSD 2-Clause "Simplified" License
383 stars 37 forks source link

Fix multiple monitor issues #19

Closed xcdkz closed 11 months ago

xcdkz commented 11 months ago

Since it's not possible to make neko work well with multiple monitors using Ebitengine, I implemented a workaround which stops neko from travelling to negative horizontal or vertical positions(which makes it stuck on the side of the screen until it's position return to the positive value) while keeping mouse on the other monitor and stops it from randomly travelling to another monitor(more about it below). I used a global variable for it since it doesn't change and there are other global variables already.

How does neko travel to another monitor? I have two monitors in a setup like this: 1080x1920 and 2560x1440. I start neko on 2560x1440 display. If neko horizontal position goes above 1440(for example when I keep cursor on the 1080x1920 monitor) then neko automatically travels to the 1080x1920 monitor(since it's the only available monitor with horizontal value this high).