Reminds me of this thing I bought a long time ago, back when phones still had headphone jacks. It was a button that plugged into that, and you could program it to do whatever you wanted. It was neat, but often didn't work too well. I wish I could remember what it was called.
Anyway, Pixels have the feature where you can tap the back of the phone and map that to an action, so we already kind of have that. Mine is mapped to the flashlight.