I use library SFML.
#include <SFML/Window.hpp> #include <SFML/Graphics.hpp> #include <SFML/System.hpp> #include <iostream> int main() { sf::RenderWindow app(sf::VideoMode(800, 600), "test"); bool running = true; while(running) { std::cout << app.GetInput().IsKeyDown(sf::Key::Left) << "\n"; } app.Display(); return 0; }
No matter how much I press the button to the left, only 0 appears on the screen. The window is in focus. What is the reason? OC - Linux.