SFML community forums
Help => Window => Topic started by: golgoth on February 11, 2013, 03:17:27 am
-
Greetings everyone,
Im have the same issue as this fella:
I'm not sure. I'll just looked at the source of SFML, and this is what it looks like:
1.Qt creates the window
2.Qt gives me the HWND
3.I give SFML the HWND Window
4.SFML attaches it's own WndProc callback function to it, but saves the previous (Qt's) WndProc.
5.SFML receives the messages, processes them, then forwards them to the previous (Qt's) WndProc.
So it looks like SFML gets to process the Win32 events before Qt. I don't know why SFML is not processing the key presses (but is receiving mouse messages) then, but why it was previously with Qt 4.8.
Any idea what could cause SFML not to process the MouseButtonPressed anymore?
-
On which OS?
-
Hi Laurent, Windows 7 & 8 that is.
-
Any hint would be welcome!
-
From this thread (http://en.sfml-dev.org/forums/index.php?topic=10599.0).
It's known that events don't work 100% when SFML is embedded into another GUI framework. It depends on the GUI framework and on the OS, and I don't know exactly why. So the best solution in this case is to use the event system of the GUI framework.
But in Qt you have to call setFocusPolicy(Qt::StrongFocus); in order for keyPressed events to be passed to SFML (take a look at the 1.6 tutoria).
-
Oh, thank you very much for your inputs eXpl0it3r;
I'll try the:
setFocusPolicy(Qt::StrongFocus);
-
setFocusPolicy(Qt::StrongFocus) might have worked for SFML 1.6 but it does not work with version 2.0.
Any other idea what might prevent keyPressed events to be passed to SFML?