This question already has an answer here:
In my use-case, I want to plug in generic numpad to my PI and have it act as a remote. As such, I would like to redirect any keyboard input to an app of my choosing right after boot. The PI is headless so I do not care much of the app also has screen control or not.
What is the best method to achieve this?