
Problem: Hiding the cursor in the game window
Posted Monday, 25 May, 2009 - 16:44 by stereo inThe 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
Re: Problem: Hiding the cursor in the game window
Working on it in the gw-next2 branch.
Re: Problem: Hiding the cursor in the game window
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.
Re: Problem: Hiding the cursor in the game window
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).
Re: Problem: Hiding the cursor in the game window
" 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.
Re: Problem: Hiding the cursor in the game window
Yes, that's what I mean, only without using Windows.Forms.
Re: Problem: Hiding the cursor in the game window
"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.
Re: Problem: Hiding the cursor in the game window
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.