I want to configure 2x/3x headset buttons presses. How can I do it?

Install any headset controller application. Here are some of them: JAYS Headset Control, Headset Droid