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

Author Topic: Feature Request: GetSelected() for sf::Window  (Read 2399 times)

0 Members and 1 Guest are viewing this topic.

Weeve

  • Jr. Member
  • **
  • Posts: 87
  • C++ Programmer (Intermediate), 3D Artist (Skilled)
    • View Profile
    • Email
Feature Request: GetSelected() for sf::Window
« on: January 08, 2013, 05:09:47 pm »
I need a feature where you can check if your sf::Window is the currently selected window, I need this because my program uses SetCursorPosition and ShowMouseCursor to lock the mouse to the middle of the screen, however, if you deselect the window, SetCursorPosition is still jamming the mouse to the position I set  ???  (Windows XP is my OS), so I would prefer if you would either make SetCursorPosition only works if the window is selected, or I would need some way to check if the window is selected so I can make the functionality. if you do consider making either feature, please Email me *****, as my project will be waiting on this, until then, I'm going to fudge it and make ESC unlock the mouse until the window is clicked again, but there are several flaws with doing so :'( , will be waiting for the email, and good luck!  ;D
« Last Edit: January 30, 2021, 09:54:07 am by Weeve »
Long live rapid project development! -- Kestrel3D Game-Engine nearing completion

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Feature Request: GetSelected() for sf::Window
« Reply #1 on: January 08, 2013, 05:32:44 pm »
Do you want to check if the window has the focus? This has already been discussed, it's possible that SFML will provide something in this direction, but not for SFML 2.0. You can already check that now, if you track the GainedFocus and LostFocus events.

By the way, don't expect people to send you e-mails for responses. This is a forum, responses are public, and you can still let yourself notify automatically.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Weeve

  • Jr. Member
  • **
  • Posts: 87
  • C++ Programmer (Intermediate), 3D Artist (Skilled)
    • View Profile
    • Email
Re: Feature Request: GetSelected() for sf::Window
« Reply #2 on: January 08, 2013, 05:38:16 pm »
Thankyou, Yes, Focus is what I mean, and GainedFocus and LostFocus works for me :D, I'm used to working with OpenGL, which is alot less friendly than merely tracking sf::Event s, thanks for the help!
Long live rapid project development! -- Kestrel3D Game-Engine nearing completion

Weeve

  • Jr. Member
  • **
  • Posts: 87
  • C++ Programmer (Intermediate), 3D Artist (Skilled)
    • View Profile
    • Email
Re: Feature Request: GetSelected() for sf::Window
« Reply #3 on: January 08, 2013, 05:49:04 pm »
Working Marvelously! thanks for the help!  ;D  ;D  ;D
Long live rapid project development! -- Kestrel3D Game-Engine nearing completion