I just switched to a shiny new G2, and I'm using the one-button earphones that came with my Nexus S 4G. This is actually the third set of such headphones (I keep breaking and replacing them), so I refuse to have them not work on my rooted but otherwise stock G2.
When I first plugged them in to the G2, it was configured so that the button would control the phone function: one press would open my call history, a double press would redial, and a hold would start up voice dialer. On the Nexus S 4G, the buttons controlled my media player, so that's what I want them to do here.
I tried various button remapping tools like the JAYS Headset Control app, but none of them would take precedence over the default LG actions.
Instead, I modified this approach from the Nexus 4, and changed the key code for the button from the one that the voice dialer controls were intercepting (HEADSETHOOK) to something else (MEDIA_NEXT).
What I did:
1. Have root and install Busybox (for vi).
2. Get a root shell on the device.
$ adb shell shell@android:/ $ su root@android:/ #
root@android:/ # mount -o rw,remount /system
root@android:/ # vi /system/usr/keylayout/Generic.kl
key 163 MEDIA_NEXT
key 163 HEADSETHOOK
key 226 HEADSETHOOK
key 226 MEDIA_NEXT
5. Reboot your device for the changes to take effect.
6. Now the button on your single-button headset is the equivalent of the "down" or "next" button on a three-button headset. To configure it, install JAYS Headset Control or a similar application. Chose the three-button headset instead of the one-button headset, and configure the third button to do everything you want your button to do.
7. Enjoy your customizable button!