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

LR SDK: How to avoid that non-interactive LrView elements "steal" the focus when clicking on them?

Contributor ,
Dec 08, 2025 Dec 08, 2025

The UI of my Focus-Points plugin comprises different elements for displaying images and text, as well as buttons and links. To allow operation using keyboard shortcuts, there is a 'hidden' edit field with tiny dimensions that records keyboard input and uses a validate() function to interpret and process shortcut characters.

 

It is possible to mix mouse and keyboard operation of interactive controls (except for using the TAB key), but when clicking any non-interactive control (e.g. static_text) the edit_field loses focus.

 

I have tried different ChatGPT suggestions (wrap non-interactive controls in a spacer or attach  mouse_down functions that consume clicks) but none of them worked.

 

Is this a matter of fact and a limitation of the SDK, or does anyone know of a way around it?

TOPICS
macOS , SDK , Windows
126
Translate
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
LEGEND ,
Dec 08, 2025 Dec 08, 2025

I don't know of any way you might solve this. The SDK doesn't provide any control over the input focus.  Also, all LrView objects are "interactive" in that they support tool tips that appear in response to mouse roll over, and static_text() also supports mouse_down().

Translate
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 ,
Dec 09, 2025 Dec 09, 2025
LATEST

Attaching mouse_down handlers does indeed work for static_text, but only if you do it for every single instance. So, only the photo and the Ko-fi icon are left as focus 'stealers'. This could be avoided by setting 'enabled' to 'false', but this would grey them out, which obviously makes no sense. It seems that I (or rather, the users) will have to live with the prohibition of clicking on a picture, since doing so breaks shortcut operations. For everything else, a mixed combination of mouse clicks and keyboard shortcuts works perfectly fine.

 

Too bad that Adobe didn't allow for clickable pictures, otherwise I could have implemented the flagging / rating icons in a way that is optically more close to Lightroom. 

 

 

Focus-Points UI.jpg

Translate
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