Ok, i am planning to enhance my Point of Sale project by adding a feature where you can add a "alarm button" (a physical object)

Now, I plan it only to be a simple circuit and i want to know the best way for it to communicate with my project, if possible and what code i would need for it.

I am not sure what way to do it that it will work with. I know USB has 5 volts of power, that could be my power source but how would i connect it with my program?

I hope i have made sense here... if not, i will try to tell you better. thanks