You should definitely read the tutorials and the documentation.
Also if you don't provide us your code or a minimal example, it's hard to find out what you are trying to do exactly.
I think you might have something like this:
while (window.isOpen())
{
sf::Event event;
while(window.pollEvent(event))
{
// ...
}
// call getKey and do something with it
int key = getKey(&window);
// ...
window.clear();
window.draw(...);
window.display();
}
The problem with this is, that pollEvent() returns events as long as there are events and the code will only continue if there are no events in queue. So there are no events exept the last one when getKey() is called.
Also, like kralo9 said, you loop until an key is pressed. The window can't draw anything until that happens and seems to be frozen.
You probably want real time input here:
int getKey(sf::RenderWindow* window)
{
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Num0))
return 0;
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Num1))
return 1;
...
}
Hope that helps.