Receiving key press and key release events in Linux terminal applications?

前端 未结 3 1826
粉色の甜心
粉色の甜心 2020-12-05 14:23

I would like to write a simple C program that will perform different actions based on both \"key down\" and \"key up\" events. This program will be run from inside rxvt.

3条回答
  •  猫巷女王i
    2020-12-05 15:07

    This won't work in the general case. ANSI terminals (from which all emulators descend) represent key "press" events only. They don't record down/up events independently.

    If you need low level keyboard event access, the proper environment is really a GUI program. Even a web application will have cleaner access to key events than a terminal.

提交回复
热议问题