need help to setup arduino as a 1 button gamecontroller


I am new at all this Arduino stuff and I want to build a DIY pc handbrake. I have a micro switch and an Arduino micro.

I have searched all night long for the code that suits my project but nothing.

I am gently asking for a library. Can please someone write it for me or lead me in the right way. I am planning to connect the switch to the pin 2

I have tried this library but that has too many axes and buttons while I need only one button. Link where you can get the example code:

Perhaps you could explain what exactly a "DIY pc handbrake" actually does. I'm confused because I've had any number of PCs and I'm pretty sure none of them ever had or needed a handbrake.

Presumably your microswitch is an input. What output(s) is it supposed produce and when?


I am going to use the handbrake in racing games and i want pc to read it as a controller not keyboard nor mice