SFML community forums

Help => Window => Topic started by: Redee on May 14, 2015, 01:29:51 pm

Title: WinApi method for read key events buffer ?
Post by: Redee on May 14, 2015, 01:29:51 pm
What winApi method Sfml using for read key events buffer ?
Now look into this functions > GetKeyboardState / GetKeyState / GetAsyncKeyState....
Someone knows ?))
Title: Re: WinApi method for read key events buffer ?
Post by: Jesper Juhl on May 14, 2015, 01:45:55 pm
Why don't you just read the source?

https://github.com/SFML/SFML/blob/master/src/SFML/Window/Win32/InputImpl.cpp
Title: Re: WinApi method for read key events buffer ?
Post by: Redee on May 14, 2015, 03:32:00 pm
Why don't you just read the source?

https://github.com/SFML/SFML/blob/master/src/SFML/Window/Win32/InputImpl.cpp

I asked for events, not for direct check key!
Title: Re: WinApi method for read key events buffer ?
Post by: Jesper Juhl on May 14, 2015, 03:33:42 pm
Then go dig up the event code.
You have the source, just look it up.
Title: Re: WinApi method for read key events buffer ?
Post by: Redee on May 14, 2015, 03:40:05 pm
We every frame call > wIn.pollEvent(eV)
But where accumulate events to Event object.....
No else functions calls to do check and approve event.

For example - if You click LMouse when your code will be change game world.
Your click accumulate to buffer.
But what it does I cant understand now.
If you know show me where this in winAPI.
Thanks in advance.

And for my research - event object read every event from winApi buffer.

Ok read next sources sfml.
Entry method is > void WindowImplWin32::processEvents

Then winAPI PeekMessage, TranslateMessage, DispatchMessage.
And no see where setted Event.
Only see after this setting MSG message object.

Damn its very tangled logic.
And no one answer me.

Anyways I'm closing research both Shifts triggered event issue.
Too tired )).
Title: Re: WinApi method for read key events buffer ?
Post by: Laurent on May 14, 2015, 06:24:02 pm
https://github.com/SFML/SFML/blob/master/src/SFML/Window/Win32/WindowImplWin32.cpp#L489
Title: Re: WinApi method for read key events buffer ?
Post by: Redee on May 14, 2015, 08:24:05 pm
Thanks, its real answer )).
But no see where first call to processEvent(), only see to processEvents().

Need to debug on call stack.
Title: Re: WinApi method for read key events buffer ?
Post by: Laurent on May 14, 2015, 08:38:23 pm
Here are the 4 important steps, in order:

1. https://github.com/SFML/SFML/blob/master/src/SFML/Window/Win32/WindowImplWin32.cpp#L412
2. https://github.com/SFML/SFML/blob/master/src/SFML/Window/Win32/WindowImplWin32.cpp#L260
3. https://github.com/SFML/SFML/blob/master/src/SFML/Window/Win32/WindowImplWin32.cpp#L1021
4. https://github.com/SFML/SFML/blob/master/src/SFML/Window/Win32/WindowImplWin32.cpp#L489
Title: Re: WinApi method for read key events buffer ?
Post by: Redee on May 14, 2015, 08:53:49 pm
Helpfully info!
Need to read msdn to understand more.
Troubles to detect work after DispatchMessage(&message);