Listbox callback misfires: after double-click, SelectionType='open' persists and Enter/Arrow keys wrongly trigger plot actions.

6 visualizzazioni (ultimi 30 giorni)
I am using a classic uicontrol('Style','listbox')–based GUI (not App Designer) that supports:
  • Double-click → plot selected parameter
  • Enter key → plot
  • Arrow keys → only change selection
  • Typed letters → incremental search
This behavior worked correctly in older MATLAB versions (up to R2024a), but in R2025a/b I see the following issue:Problem
After a double-click, the listbox callback is triggered again on the next keyboard event, and
SelectionType is still reported as 'open'.
Because of this:
  • Arrow ↑/↓ after double-click plots again (unexpected)
  • Enter sometimes plots twice
  • It looks like 'open' “sticks” for one extra callback even though no mouse click occurred
Example callback pattern (simplified)
if isKeyEvent
if strcmp(eventData.Key,'return')
plot(...)
end
else
if strcmp(get(gcf,'SelectionType'),'open')
plot(...)
end
end
This logic still works in older MATLAB versions but produces incorrect behavior in R2025a/b due to the lingering 'open' state.Questions
  1. Is this a known issue or expected behavior?
  2. Is there a reliable way to detect a true double-click on a listbox in newer MATLAB versions?
  3. Should this be reported as a bug?
Any advice or workarounds would be appreciated.

Risposte (0)

Categorie

Scopri di più su Environment and Settings in Help Center e File Exchange

Prodotti


Release

R2025b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by