SFML community forums

Help => Window => Topic started by: Jove on July 04, 2012, 02:45:16 pm

Title: How to disable mouse but still read it?
Post by: Jove on July 04, 2012, 02:45:16 pm
When my GUI is in use I would like the OS cursor to be visible and work outside my window (normal).

In-game I'd like the OS pointer to be invisible and not able to be seen outside the window, just read the mouse so I can change the position of my game cursor which controls the direction of the main sprite.

Currently I'm doing this by disabling the cursor visibility and repositioning it's x & y if they go outside the window bounds. It works, but in windowed mode the OS cursor can still creep outside the window and register a click, like a right click, which then brings up the context menu. Pretty shabby and interrupts proceedings.

I've seen other games accomplish this, any help on how to do this in SFML(2RC)?
Title: Re: How to disable mouse but still read it?
Post by: Laurent on July 04, 2012, 03:02:49 pm
Is that what you want?
http://en.sfml-dev.org/forums/index.php?topic=1876.0
Title: Re: How to disable mouse but still read it?
Post by: Jove on July 04, 2012, 05:04:23 pm
I see.  The mouse move deltas were what I originally went looking for, +1 on that.
Title: Re: How to disable mouse but still read it?
Post by: eXpl0it3r on July 04, 2012, 05:49:40 pm
Yes, raw input looks like an important feature (not only for mouse, for keyboard too).

Will this then be included in some future version? Or is that already what sf::Mouse and sf::Keyboard represent?
Title: Re: How to disable mouse but still read it?
Post by: Laurent on July 04, 2012, 06:09:47 pm
Quote
Will this then be included in some future version? Or is that already what sf::Mouse and sf::Keyboard represent?
No, it's a different feature. "Raw" means "not filtered/interpreted by the OS" here; directly from the device.