Skip to main content
Karsten.G
Known Participant
December 8, 2025
Question

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

  • December 8, 2025
  • 1 reply
  • 161 views

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?

1 reply

johnrellis
Legend
December 9, 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().

Karsten.G
Karsten.GAuthor
Known Participant
December 9, 2025

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