Issue with capturing "tab" key using the available KeyPressFcn callbacks in AppDesigner

4 次查看(过去 30 天)
I'm working on a GUI using App Designer, and I'm facing difficulties capturing the "tab" key within an editable DropDown list to enable text autocompletion based on user input. Despite multiple attempts, I haven't been successful in achieving the desired functionality. I'm reaching out to the community to seek assistance or solutions for this particular challenge. Here's some additional context:
Background:
  • UIFigure components like DropDown lists currently lack a built-in "KeyPressFcn" property to capture key events while focused.
  • Existing callbacks like "UIFigureWindowKeyPress" don't trigger the “tab” key when the focus is within the DropDown list and the Dropdown list is open, limiting interaction options.
Observations:
  • Attempts to define "KeyPressFcn" programmatically in App Designer code throw errors like "Unrecognized property 'KeyPressFcn' for class 'matlab.ui.control.DropDown.'"
  • Implementing a generic "UIFigureKeyPress" callback doesn't address the root cause as the focus remains within the DropDown list, preventing key capture.
Expected Behavior:
  • In order to illustrate the situation, I added an example of this functionality using MS Excel. As shown in the attached GIF, ideally, users should be able to capture key presses even when focusing on UIFigure components like DropDown lists. This allows for richer application interactions and user experiences.
If anyone has encountered and resolved a similar issue, I would greatly appreciate it if you could share your solution. Alternatively, I'd like to propose the following approach:
  • I propose the addition of a "KeyPressFcn" property to DropDown lists and other relevant UIFigure components.
  • Alternatively, implementing the ability to add custom callbacks to any component would offer greater flexibility for capturing user interaction beyond existing predefined callbacks.
Thank you in advance,
Juan
  2 个评论
Juan Ruiz Osorio
Juan Ruiz Osorio 2024-1-19
I forgot to add that at the moment the expected behavior can be achieved in App Designer using the "Enter" key when an item of the DropDownList is selected, but the purpose of this question is to achieve this functionality using the "tab" key which in my opinion is widely used for this purpose in other software.
Tiffany
Tiffany 2024-4-5
Hi Juan,
I would like to apologize for the inconvienece you face when attempting to add this functionality into the "tab" key. I've made our development team aware of your proposed enhancements, so they can consider implementing these features in future releases.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 App Building 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by