• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

[Q] Event handling tool, module and image

Contributor ,
Oct 09, 2017 Oct 09, 2017

Copy link to clipboard

Copied

Hi all,

I'm still new to Lua and not sure if we can implement in SDK,

but I'd like to handle following events.

1) Current module changes

    There is LrApplicationView.getCurrentModuleName().

2) Current tool changes in Develop mode

    There is LrDevelopController.getSelectedTool().

3) Selected image changes

     There is LrCatalog.getTargetPhoto() and LrCatalog.getTargetPhotos()

1)-3) seems at least readable, so I think we can implement as timered polling.

But can it be event driven like addEventListner function in JavaScript?

Thank you,

Naoki

TOPICS
SDK

Views

380

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Oct 09, 2017 Oct 09, 2017

Polling can work pretty well if carefully implemented. 

You might also consider:

LrAnalytics.observeModuleChange() -- undocumented, I've never seen reports of someone trying it

LrApplication.addActivePhotoChangeObserver() -- undocumented, Re: Observe when a photo has been selected within the library module?

LrDevelopController.addAdjustmentChangeObserver()

Votes

Translate

Translate
LEGEND ,
Oct 09, 2017 Oct 09, 2017

Copy link to clipboard

Copied

Polling can work pretty well if carefully implemented. 

You might also consider:

LrAnalytics.observeModuleChange() -- undocumented, I've never seen reports of someone trying it

LrApplication.addActivePhotoChangeObserver() -- undocumented, Re: Observe when a photo has been selected within the library module?

LrDevelopController.addAdjustmentChangeObserver()

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 10, 2017 Oct 10, 2017

Copy link to clipboard

Copied

LATEST

johnrellis

Thank you very much for the pointers.

It is very helpful.

-Naoki

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines