Skip to content

Instantly share code, notes, and snippets.

@chromabox
Created August 1, 2014 05:47
Show Gist options
  • Save chromabox/562c2990e9f7012715cb to your computer and use it in GitHub Desktop.
Save chromabox/562c2990e9f7012715cb to your computer and use it in GitHub Desktop.
キーボードから入力されたcodeと対応する文字列を出すやつ
// キーボードから入力された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