When the user press a key in desktop or console or a browser or anywhere. I want to get the key that is pressed by user. (like a keylogger)

I found something about that

I can make my intterrup handler (IRQ) but if I change the original interrupt handler, the computer must be rebooted or I must made the interrupt handler, the original handler from my handler and I don't know whether that is can be done in kernel 2.6.x

I can use tty device but how ?(I don't know exactly what tty is I just found searching keylogger for linux.

and there is a function scancode = inb(0x60);

maybe that can bu used.

maybe with systemCalls but in kernel 2.6.x the system Call Table I think it can't be changed.

I want to add functions to some keys. (If the user press 'S' I will write the system time to the logs , (If the user press 'P I want to write process list to the logs)

(Module Programming(possibly it will be a char device driver) with C)