Skip to main content
megamau
Inspiring
July 7, 2022
Answered

Get mouse position on click in comp preview

  • July 7, 2022
  • 3 replies
  • 1123 views

I want to get the position of the mouse when the user clicks in the comp window. I can get the mouse position using OS calls, but I want the relative position, exactly like PF_Param_POINT does it when you press that target button next to the parameter value.

 

I though about geting the size and position of the comp and then calculate the mouse position using the OS mouse calls, but I don't know how to get the position and size of the comp.

 

Another option would be to add a hidden PF_Param_POINT, and force the activation of the pick tool from the parameter, but I didn't find a way to activate it without user input.

 

Any ideas?

This topic has been closed for replies.
Correct answer shachar carmi

take a look at the "CCU" SDK sample project. it shows hot to get the mouse click location in the comp window coordinates, and how to convert those into layer source coordinates.

3 replies

Participating Frequently
May 29, 2024

Same question. How did you solve it?

Community Expert
May 29, 2024

the mouse coordinates are part of the data passed to the plugin on a ui event call. take a look at the "CCU" sample project, it's implemented there. no solution required, just copy paste from there.

Participating Frequently
May 30, 2024

em....What is "CCU" sample?

shachar carmiCommunity ExpertCorrect answer
Community Expert
July 7, 2022

take a look at the "CCU" SDK sample project. it shows hot to get the mouse click location in the comp window coordinates, and how to convert those into layer source coordinates.

megamau
megamauAuthor
Inspiring
July 8, 2022

Thank you Shachar, this is exactly what I want.

Mylenium
Legend
July 7, 2022

I don't think there's any chance of doing that since the viewer has it's own life and you don't know anything about how the panel is set up in the API.

 

Mylenium