Although it doesn't exactly listen to the hardware buttons, you could use this extension:
You can use the ActivityStarter component to open WhatsApp: