[button] Replace dirty hack with a better, more reliable one

This will let me sleep better at night...lol