CnCNet / ts-ddraw

Rewrite of cnc-ddraw with Tiberian Sun as the target
397 stars 44 forks source link

Mouse isn't properly captured #1

Closed anpage closed 6 years ago

anpage commented 10 years ago

This project is a godsend. Finally a way to have TS working well under Windows 8. I really appreciate the work you're doing. Of all the (very minor) issues, one really stands out to me as it actually affects gameplay.

When in windowed mode or fullscreen with multiple monitors (like I usually do), the mouse isn't captured properly and it moves outside of the game window. The game still scrolls in that direction, but it's annoying when the mouse keeps leaving the screen.

DLL Version: 6269769701 Game Version: Tiberian Sun 2.03 (Origin) OS: Windows 8.1 x64

I'm in no rush to have this fixed as I can disable my extra monitors or just endure the slightly annoying issue for the time being. Thanks.

anpage commented 10 years ago

I've done my own (probably very hacky) solution to this problem, seen here: 098a01897dea485c09d07f99c27b5ebea223a325

It works well in fullscreen but doesn't affect windowed mode at all, which doesn't bother me because I'd rather play in the former mode.

hifi commented 10 years ago

While containing the mouse in fullscreen is completely fine and fixes the issue of mouse leaving the window with multiple monitors, windowed mode is a bit different. I don't think the games ever locked the cursor inside the windowed game window so as to stay true I wouldn't necessarily implement forcing in windowed mode.

On the other hand, having a simple command of having some key down to allow the cursor to leave the window might be a viable solution as that's what I use in my personal build of cnc-ddraw and it isn't as intrusive as the Ctrl-Tab binding cnc-ddraw has.

Good thing you found the opengl branch as that's what I'm currently developing. I'm in the middle of a big refactor to fix some outstanding issues in opengl mode and to implement the global ddraw lock.