...to see if there was a function return to check if the window was currently active or not, but couldn't see anything...
...
Does anyone have a solution
...
I was looking to do something along the lines of
if(window.isActive() && sf::Keyboard::isKeyPressed(sf::Keyboard::A))
I do what zsbzsb mentioned - keeping track of focus events with a boolean; it works well enough. However, applications occasionally start without focus so it needs to lose it and regain it for your boolean to be correct. I believe there is a ticket for this fix on SFML.
You didn't mention which operating system you are using but there is a temporary solution for Windows. You'll need to #include <Windows.h> and use this line:
SetForegroundWindow(window.getSystemHandle());
after creating the window with SFML. window is the window that was created.
This should also send a sf::Event::GainedFocus event to the application.