How to listen to events without opening a window?

Asked

Viewed 84 times

0

I’m doing a simple project of console people who are going to make Keyboard hooking, but I don’t want you to open the SFML Opengl window. There is a way to listen to SFML events without opening a window?

  • If I’m not mistaken, to make Keyboard hooking using SFML you have to open a window. A solution would be to use a common thread to capture keyboard keys on the console itself.

1 answer

0


It is only necessary to listen to the event within a thread. In generic code, for example:

void callback()
{
    while(true)
    {
        if(pressionado(tecla))
        {
            // o que for necessário
        }
    }
}

And then the function is inserted into a thread.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.