Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How to disable mouse but still read it?  (Read 5130 times)

0 Members and 1 Guest are viewing this topic.

Jove

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • http://www.jestofevekites.com/
How to disable mouse but still read it?
« 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)?
{much better code}

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: How to disable mouse but still read it?
« Reply #1 on: July 04, 2012, 03:02:49 pm »
Laurent Gomila - SFML developer

Jove

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • http://www.jestofevekites.com/
Re: How to disable mouse but still read it?
« Reply #2 on: July 04, 2012, 05:04:23 pm »
I see.  The mouse move deltas were what I originally went looking for, +1 on that.
{much better code}

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: How to disable mouse but still read it?
« Reply #3 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?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: How to disable mouse but still read it?
« Reply #4 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.
Laurent Gomila - SFML developer