JustOneMan
JustOneMan

Reputation: 202

How to simulate press a key in linux kernel module?

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.

Upvotes: 0

Views: 877

Answers (1)

stark
stark

Reputation: 13189

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.

Upvotes: 1

Related Questions