depends on the OS, and what you are trying to do. this question talks about my efforts in reverse engineering a keyboard to get it to work in linux, and the tools mentioned there are a good start, assuming they still work this question is pretty neat too, assuming you want to focus on keyboards.