Take a look at the custom component ButtonSw32, which debounces and process button press/release events.
In the Application Note you will find a "Button long press demo" project, which is close to what you want. You would have to update clock source for PSoC4 (see e.g. WDT timer examples).
Thank you !
Your code is very clear , and the comments helps a lot .
Very nice implementation !
seems to work.