MATLAB appdesigner chage selected cell in UItable

672 Views Asked by At

I have a UItable in MATLAB appdesigner, let's say 'app.UITable'. Can I change the selected cell via callback function? For example, I would like to move one cell down when Enter key is pressed. For what I read, new MATLAB uiobjects do not accept button-press callbacks. Is that true? or is there any known hack to do that? Thank you.

Related post

1

There are 1 best solutions below

0
Dev-iL On

As of R2018b, new figure interactions were added. Regarding your specific question, you should take a look at these new keyboard interaction callbacks:

  • KeyPressFcn - This callback function executes when the user presses a key while the figure or a child object has focus. If the user presses a key on a UIControl or Table component, the callback does not execute unless the Enable property is set to 'off'.
  • KeyReleaseFcn - This callback function executes when the user presses [sic] a key while the figure or a child object has focus. If the user releases a key on a UIControl or Table component, the callback does not execute unless the Enable property is set to 'off'.
  • WindowKeyPressFcn - This callback function executes when the user presses a key while the figure or a child object has focus.
  • WindowKeyReleaseFcn - This callback function executes when the user releases a key while the figure or a child object has focus..

See also: R2018 Release notes.