Id like to manage the buttonpress or release event on an object ie. an image using ST and not the visualization. I found that there is a library for this, cmp3clutter, but i couldnt find out how to use it properly and there is no example of usage anywhere.
If somebody could help me it would be much appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was able to do it and i leave the code for someone who might need it.
//Declare global variables to associate with the actions you want the objects to do
buttonenter1 : UDINT;
buttonleave1 : UDINT;
//in the LoopCode you have to associate each variable to the event you want to register
IF pagina<>paginaanterior THEN
buttonenter1:= PantallaPrincipal.PowerButton.RegisterEvent(ADR(Events.EVENT_ENTER));
buttonleave1:= PantallaPrincipal.PowerButton.RegisterEvent(ADR(Events.EVENT_LEAVE));
paginaanterior:=pagina;
END_IF
//In MyEvents(FUN) you can say to the program what to do each time an event is triggered.
Id like to manage the buttonpress or release event on an object ie. an image using ST and not the visualization. I found that there is a library for this, cmp3clutter, but i couldnt find out how to use it properly and there is no example of usage anywhere.
If somebody could help me it would be much appreciated.
I was able to do it and i leave the code for someone who might need it.
//Declare global variables to associate with the actions you want the objects to do
buttonenter1 : UDINT;
buttonleave1 : UDINT;
//in the LoopCode you have to associate each variable to the event you want to register
IF pagina<>paginaanterior THEN
buttonenter1:= PantallaPrincipal.PowerButton.RegisterEvent(ADR(Events.EVENT_ENTER));
buttonleave1:= PantallaPrincipal.PowerButton.RegisterEvent(ADR(Events.EVENT_LEAVE));
paginaanterior:=pagina;
END_IF
//In MyEvents(FUN) you can say to the program what to do each time an event is triggered.
CASE pagina OF
end_case
Hey,
I am unsure what you are trying to do?
Why is "Execute ST Code" not usable for you?
Best regards,
Marcel
Is not very clear what do you want?
But a simple event press and release with debounce could be as follow:
Functions, or if you prefer methods or actions are called only once after debounce time on falling or rising edges.