Tuesday, August 23, 2022

[FIXED] How to simulate press a key in linux kernel module?

Issue

How to simulate press a key in linux kernel module? I saw keybdev.c, but in my case I cant compile it `

error: implicit declaration of function ‘handle_scancode’

Maybe it's obsolete.


Solution

In the kernel, keyboards can call input_report_key which generates a keyboard event. The USB keyboard driver in /drivers/hid/usbhid/usbkbd.c is a good example of code to do both keyboard input and LED output.



Answered By - stark
Answer Checked By - Mildred Charles (PHPFixing Admin)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.