cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

On Button Released Event for Mashups

drieder
16-Pearl

On Button Released Event for Mashups

Hello everyone,

 

I would like to be able to track whether a button was released in a mashup. So far I can only see the onClicked event.

 

I am designing a controller with 4 arrows (up, down, left, right) and I want my remote thing to move accordingly as long as these buttons are pressed. So far I have services for each direction which let the object move in this direction until it is stopped. Thats why I hoped to be able to recognize whether the button has been release, so I can call the stop service.

 

controller.png

 

Please feel free to suggest different approaches for this use case if the release button event is somehow not possible to track.

 

Best Regards,

Dominik

ACCEPTED SOLUTION

Accepted Solutions
vxavier
14-Alexandrite
(To:drieder)

Hello Dominik,

 

So, I didn't find any property or event that do what you want. But, there is an active class in the widget files. You can use this documentation to create your own event:

 

https://www.ptc.com/support/-/media/358363C347B6425BA74531EAE94BCB5D.pdf?sc_lang=en

 

Also, there is a widget folder where you can find the files of the button widget to create your new custom extension with little changes.

 

One suggest is to make the controls a little different. Move when clicked and stop moving when clicked again. It is an easier approach(you will not need to create a new extension), but not so intuitive for the end user. 

View solution in original post

4 REPLIES 4
vxavier
14-Alexandrite
(To:drieder)

Hello Dominik,

 

So, I didn't find any property or event that do what you want. But, there is an active class in the widget files. You can use this documentation to create your own event:

 

https://www.ptc.com/support/-/media/358363C347B6425BA74531EAE94BCB5D.pdf?sc_lang=en

 

Also, there is a widget folder where you can find the files of the button widget to create your new custom extension with little changes.

 

One suggest is to make the controls a little different. Move when clicked and stop moving when clicked again. It is an easier approach(you will not need to create a new extension), but not so intuitive for the end user. 

Thank you for your reply. I hoped I could avoid creating a new widget since it seems quite difficult. Probably I will change the controls as you suggested.

 

But when you already here, do you maybe know how to set images for buttons? Currently I can only set the text right? I would like to have the buttons look like arrows, but I saw the image widgets are missing click events. 

 

Regards,

Dominik

vxavier
14-Alexandrite
(To:drieder)

In the button widget you can put images in the style property, if you want to show just the arrows let everything else transparent and without labor:

image.png

Awesome, Thank you very much!

Announcements


Top Tags