
[NativeWindow] Add ability to hide/show/modify the mouse cursor
Posted Friday, 12 February, 2010 - 15:29 by the Fiddler| Project: | The Open Toolkit library |
| Version: | 1.1-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | critical |
| Assigned: | the Fiddler |
| Status: | in progress |
Jump to:
Description
Currently, the only way to do this is to set System.Windows.Forms.Cursor.Current to an empty cursor (Cursor.Hide() is not supported on Mono).
OpenTK applications should not need to rely on WinForms for this functionality.


Comments
#11
These methods don't hide the cursor globally - once the cursor leaves the window, it becomes visible again.
I think this is generally desirable - one often wants to hide the cursor during a splash screen, but would like the user to be able to mouse out of the program if they want to do somethign else while they wait.
A separate CaptureCursor flag would be nice to disassociate cursor movement, to prevent the user from unintentionally mousing outside while actually playing a game.
#12
For the first-person control is desirable to position the cursor (mouse pointer) in the center of the window, then it is necessary to indicate the position as "System.Windows.Forms.Cursor.Position."
Regards, ...
#13
RawInput IIRC can be used to alter the value before the WM_Mouse is generated, which allows you to change the value an application receives. Basically you keep changing relative position change to 0 so the OS and Cursor think the mouse isn't moving while you process the data. Clipping the rectangle to the renderingwindow is fine too though.
#14
This interacts with issue #969: [Input] Add static classes for Mouse, Keyboard and GamePad input.
#15
If this is completed am I correct in assuming that OpenTK is the only Open Source, C#, Cross Platform, OpenGL framework that allows capture of the mouse? And that this would be the only way to write an FPS engine?
#16
Pretty much, yes.
It is possible to hack relative mouse motions through WinForms but this is not as nice as real support.