messing with my friends

i made a little program to mess with my friends a little bit.

here is the code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "stdafx.h"
#include <Windows.h>
#include <stdio.h>

using namespace std;

int main(){

	FreeConsole();

	SwapMouseButton(true);
	Sleep(10000);
	SwapMouseButton(false);

}


the code swithces the mouse buttons for 10 seconds. the only thing i wanna do to improve the program is to remove the 10 seconds thing, so that the program will run untill the user presses a certain key on his keyboard.
does anyone know how to do this?
If you want it to be any key, cin.get() should work fine, otherwise use SFML or something to register key presses.
SFML? care to explain what that is?
Easy way to interact with hardware. For something like this, which involves just checking for one keypress, it shouldn't be hard.

Do the appropiate getting started section on here: http://www.sfml-dev.org/tutorials/1.6/
And you can read this part for keypresses: http://www.sfml-dev.org/tutorials/1.6/window-events.php
so sfml works like sdl, only a dfferent library?
Yeah. If you have SDL, just use that though :/
ok thanks for the help
Topic archived. No new replies allowed.