stereo's picture

Problem: Hiding the cursor in the game window

The GameWindow class doesn't have the method allowing to hide the cursor in the client rectangle area. The existing Cursor.Hide() method applies for the entire window, not for the client rectangle area. I think that the Game Window class should have the properities: IsMouseVisible letting hide the mouse cursor in the client rectangle area.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

Working on it in the gw-next2 branch.

puklaus's picture

Im using System.Windows.Forms.Cursor.Hide();
but it doesnt hide cursor on linux. I tried create empty bitmap and set it to
cursor, cursor still exists.. have no idea how I hide cursor there.

the Fiddler's picture

An empty cursor icon should work. Maybe a call to Application.DoEvents() after setting the icon would help.

I am working to add native support right now (window icons, location, size, client size and focus are already implemented, cursors grabbing & hiding is next on the list).

puklaus's picture

" cursors grabbing"
Do you mean this?

http://dhost.info/haima/ax/OpenTKInputReader.cs

On Capture() method, there that ownMouse, this make cursor always center of the window,
relMouseX and relMouseY is used when rotating camera.

Maybe you didnt mean this.

the Fiddler's picture

Yes, that's what I mean, only without using Windows.Forms.

puklaus's picture

"only without using Windows.Forms."

Why, if next GameWIndow uses Windows.Forms?

First I made that same effect using PointToScreen and Mouse.X&Mouse.Y,
ita was quite hackish and bad code (because must calculate borders and topbar width/&height too)..
well I was using Windows.Forms.Cursor.Position (or something
like that) to set the cursor always center of the window, dont even know other way setting cursor pos.

the Fiddler's picture

Right now, the only way to center the mouse cursor is to use WinForms. The plan is to implement this functionality in the GameWindow, so you don't need to reference System.Windows.Forms from your application.