Currently know about is/dev/input/event * can monitor keyboard events, but print is input code, what I want is a string
CodePudding user response:
Continuous read, and it is the key valueCodePudding user response:
https://blog.csdn.net/qq_20553613/article/details/79216665#commentsCodePudding user response:
Your program is running in the background? If it is a daemon, to capture key, is likely to be more thorough understanding of the Linux kernel "input" input subsystem, or/dev/input/event handling,Now you output the wrong data should be coding problem, need to input accordingly,
CodePudding user response:
For example, in a development version (no screen, through SSH terminal operation) plug in a usb keyboard), I need real-time monitoring program what characters, tapping the keyboard I know/dev/input/event * can monitor keyboard events, related code can also find on the net, I under a demo, knock down the Q button, printed istype: 4 code: the value of 16:0according to the input. H 16 is on behalf of the Q key can know, but I need the string, not plastic, have a way to put these plastic value converted to the corresponding string?