Created
August 1, 2014 05:47
-
-
Save chromabox/562c2990e9f7012715cb to your computer and use it in GitHub Desktop.
キーボードから入力されたcodeと対応する文字列を出すやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// キーボードから入力されたcodeと対応する文字列を出すやつ | |
// $ gcc -o keycode keycode.c -lncurses | |
#include <stdio.h> | |
#include <ncurses.h> | |
int main(void) | |
{ | |
initscr(); | |
noecho(); | |
cbreak(); | |
keypad(stdscr,TRUE); | |
while(1){ | |
int c = getch(); | |
mvprintw(0,0,"keycode is %d keyname %s \n",c,keyname(c)); | |
} | |
endwin(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment