#include <iostream>
#include <SFML\Graphics.hpp>
#include <sstream>
#include <conio.h>
int screen_width = 640, screen_height = 480;
sf::RenderWindow window(sf::VideoMode(screen_width, screen_height), "SFML works!", sf::Style::Default);
sf::Event event;
bool test_ = false;
void GETCH()
{
if (event.type == sf::Event::TextEntered)
{
if (test_ == false)
{
std::cout << "pass";
}
test_ = true;
}
else
{
test_ = false;
}
}
int main()
{
std::stringstream ss;
while (window.isOpen())
{
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear(sf::Color(0, 0, 0, 255));
GETCH();
window.display();
}
return 0;
}
There you go friend copy paste.
As I said before I'm if you hold down a key and move the mouse over the screen it starts to skip the function and repeat the letters.
1 Type the code into a compiler
2 compile
3 hold down any key to so that "pass" shows in the compiler only once
4 now here's the tricky part GRAB THE MOUSE AND MOVE IT ACCROSS THE SCREEN
5 pass will show up REPEATEDLY while you are holding the button
6 It's super simple, it's a glitch, and the problem is that if I want to have both keyboard and mouse I either have to cash the entire library and find a different one, or modify the library and delete the mouse function and use a third party mouse detection but probably the former.