How can I detect keyboard event in C language without using third party libraries? Should I use signal handling?