I'm trying to get my keyboard leds (numlock, capslock, etc.) to blink and after some searching I found this can be done by using an ioctl function:
int fd = open( "/dev/console", O_RDWR | O_NOCTTY );
int led = LED_NUM;
ioctl( fd, KDSETLED, led );
At first it didn't work, but after a lot of time wasted, I found out it does
work when run as root.
I tried changing permissions and ownership of /dev/console, but no luck.
I know there are some (X related) alternatives, and some ways to use fake keypresses, but I don't want that. I just want to know if there's any
way to use the ioctl without being root. I even don't mind to patch my kernel if I knew where to change the code.
If anyone could help, I would be very grateful. Thanks in advance.