Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Window
»
problem with unactive window and events
Print
Pages: [
1
]
Author
Topic: problem with unactive window and events (Read 2121 times)
0 Members and 1 Guest are viewing this topic.
Soul
Newbie
Posts: 44
problem with unactive window and events
«
on:
May 03, 2014, 04:13:10 pm »
Hey, i have a problem with renderwindow and events, when my mouse is outside window, this window capture mouse position and keyboard events, how can i disable that functions?
Logged
Ixrec
Hero Member
Posts: 1241
Re: problem with unactive window and events
«
Reply #1 on:
May 03, 2014, 04:36:51 pm »
You can't disable it, but since you have access to mouse position, window position and window size, it's fairly easy to filter out these events on your own if you don't want to process them.
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: problem with unactive window and events
«
Reply #2 on:
May 03, 2014, 04:45:17 pm »
If you really use
events
, you shouldn't receive them if the window
doesn't have the focus
(which is different from "mouse outside the window").
Logged
Laurent Gomila - SFML developer
Soul
Newbie
Posts: 44
Re: problem with unactive window and events
«
Reply #3 on:
May 03, 2014, 04:52:09 pm »
u use sf::Keyboard, hmm so i must code a simple function to make the solution, thanks for help
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: problem with unactive window and events
«
Reply #4 on:
May 03, 2014, 05:06:54 pm »
Ok, so you're not really using events
Be careful when you describe your problem.
Two simple solutions:
- use events instead (sf::Event::KeyPressed)
- grab the latest revision and use the new hasFocus() function (I think it's still in a separate branch)
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Help
»
Window
»
problem with unactive window and events
anything