I'm pretty sure any (consistently reliable) method outside of a custom ROM or Xposed would have to prevent your device from entering deep sleep, in order to monitor your button touches (see: Tasker). Otherwise, if you're ready to jump from stock, Cataclysm ROM has been updated to 5.0 and...