Hardware Keyboard Support

Hi

I would like to know if there is any way to capture the clicked key on a keyboard connected to an android tablet or android mobile phone.

Is there any example?

Thank you very much.

Regards.