Access Keystrokes in C

前端 未结 2 779
傲寒
傲寒 2020-12-21 23:03

I am trying to access keystrokes in C. I can access alphanumeric keys. How can I access Control, Shift and Alt key?
Plus I read some

2条回答
  •  梦毁少年i
    2020-12-21 23:30

    Dietrich Epp answered in a comment: use ncurses library.

    See also this question

    And you might make an X11 client graphical application; in that case use a graphical toolkit library like GTK or Qt

    If you want to make a console application, use ncurses or perhaps readline

    And your question, when taken literally, has no sense: the strict C standard don't know what a key or a keystroke is (the only I/O operations mentioned in the standard are related to thru FILE). This is why most people uses additional libraries and standards (in addition of those required by ISO C), eg. Posix...

提交回复
热议问题