Cb mic for American Truck simulator or ets2

Hi I'm very new to the arduino family, I want to turn a real cb radio mic into an in game cb in the multi player mod. (truckersmp). It is push to talk by pushing the x key. So I want to be able to push the cb button and just talk and I don't know how to wire or code it. I'm going to be using an arduino mini pro I think, or a teensy 2.0.

You just need to read the microphone switch? Then what? Then you want to interface the Arduino with the game? ….I can't help you with that.

If you don't have a schematic or wiring diagram for the mic, you'll need to "find" the switch wires/connections with a multimeter (reading resistance). The [u]Button Example[/u] shows you how to read a switch/pushbutton. Or, you can wire the switch the "opposite way", using the [u]Internal pull-up resistor[/u]. The logic will be reversed but that's easily handled in software.

coltsfan77:
It is push to talk by pushing the x key. [...] I'm going to be using an arduino mini pro

To emulate a USB keyboard, the most popular options are the Arduino Leonardo or Pro Micro. In fact, most microcontrollers that have native USB client support (that don't require a USB to serial converter to program them) should do the job.