Generate Event on receiving input in Linux


I was wondering if Linux is capable of generating events upon receiving input at the attached devices (Keypad, UARTs). In Windows, for eg when we move the mouse cursor, we receive events that contain information about the event. We would then implement an event handler to handle those events.

What I am trying to achieve is that an event would be generated upon receiving an input on any of the File Descriptors (inputs) and my application code would handle those events.

Does anyone know about good resources that I can refer to make this possible?

Thanks in advance.

Did you have a look at select, poll and epoll? You might find the evtest source code helpful as well.