
		Thihup
		
		(usa Manjaro Linux)
		
		Enviado em 16/05/2015 - 10:01h 
		Olha, é código usando a windowAPI. É meio difícil ajudar, mas vamos ver se consigo.
Criei um arquivo e acho que dá de fazer a mesma coisa. Mas aqui eu eu utilizei uma forma insegura, pois "criei" o getch, mas apenas para este exemplo, não recomendo utilizar!
Mas se existe aí no Windows, só usar (acho que tem na tão "famosa" ConIO.h)
Segue:
 
#include <fstream>
#include <iostream>
#include <termios.h>
#include <unistd.h>
using namespace std;
int getch( ) {
  struct termios oldt,
                 newt;
  int            ch;
  tcgetattr( STDIN_FILENO, &oldt );
  newt = oldt;
  newt.c_lflag &= ~( ICANON | ECHO );
  tcsetattr( STDIN_FILENO, TCSANOW, &newt );
  ch = getchar();
  tcsetattr( STDIN_FILENO, TCSANOW, &oldt );
  return ch;
}
int main(){
	string teclas;
	// 27 é o Esc
	int letra;
	while((letra = getch()) != 27){
		teclas += (char)letra;
		cout << (char)letra;
	}
	ofstream makefile;
	makefile.open("/tmp/Makefile");
	makefile << teclas;
	makefile.close();
	return 0;
}
 
Espero ter ajudado
[]'s
T+
--
Profissão: Ser Rejeitado pelo VOL!