electro-smith / libDaisy

Hardware Library for the Daisy Audio Platform
https://www.electro-smith.com/daisy
MIT License
331 stars 143 forks source link

Added virtual function to detect user interaction. #507

Closed ifranco closed 2 years ago

ifranco commented 2 years ago

I need a way to detect any interaction with the UI system. The use case was to be able to have a page close itself after a timeout if there's no user input. I believe the event needs to propagate to all the pages, so it uses a loop triggered right after ProcessEvent(e) inside the Ui::Process function. Maybe it should be inside the if that checks for an invalid event type?

stephenhensley commented 2 years ago

It's looking good!

Definitely a useful feature!

I've done some similar things with some external mechanics added into the UI stuff on some fairly recent projects. So this will certainly come in handy!

Thanks for the contribution! I'll do a final check and get it merged a bit later!

ifranco commented 2 years ago

It's looking good!

Definitely a useful feature!

I've done some similar things with some external mechanics added into the UI stuff on some fairly recent projects. So this will certainly come in handy!

Thanks for the contribution! I'll do a final check and get it merged a bit later!

Thanks! My pleasure.