br_viseu Posted May 15, 2008 at 09:32 AM Report Share #185240 Posted May 15, 2008 at 09:32 AM int main() { char ch; // initscr(); //Inicializa a ncurses clear(); //Limpa a tela //mvprintw(3, 10, "Olá, Mundo!"); //Na linha 3, coluna 3 escreva Olá, Mundo! refresh(); //Atualizar tela ch= getch(); switch (ch) { case KEY_BACKSPACE: /* user pressed backspace */ printf("Tecla Apagar premida"); break; case KEY_UP: /* user pressed up arrow key */ printf("ACIMA"); break; case KEY_DOWN: /* user pressed up arrow key */ printf("ABAixo"); break; defaultrintf("Nenhuma deestas "); } endwin(); //Finalizar ncurses return(0); } Porque é k isto n faz o k eu quero kd carrego no backspace?(aparece "^?" Link to comment Share on other sites More sharing options...
nata79 Posted May 15, 2008 at 05:42 PM Report Share #185325 Posted May 15, 2008 at 05:42 PM n podes usar o printf() com o ncurses, podes usar, por exemplo, o printw() que é equivalente ao printf() mas para ncurses e o ch deve ser declarado como um inteiro que é o tipo devolvido pela função getch(). arithmeticoverflow.wordpress.com Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now