How to detect key presses in a Linux C GUI program without prompting the user?

前端 未结 4 1917
一生所求
一生所求 2020-12-04 00:24

how to detect a keyboard event in C without prompting the user in linux? That is the program running should terminate by pressing any key. can anyone please help with this?<

4条回答
  •  情深已故
    2020-12-04 01:15

    If you want to do that in a graphical application, you should use some libraries to do this.

    Such a simple task can be easily done with whatever library (even low level ones like Xlib).

    Just choose one and look for a tutorial that shows how to handle keyboard events.

提交回复
热议问题