Can I use interactive features like "KeyPressFcn" in App Designer?
    6 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    MathWorks Support Team
    
 il 15 Mar 2018
  
    
    
    
    
    Risposto: ILoveMATLAB
      
 il 3 Gen 2019
            Can I use interactive features like "KeyPressFcn" in App Designer?
Risposta accettata
  MathWorks Support Team
    
 il 15 Mar 2018
        Interactive features such as "KeyPressFcn" are not yet supported for App Designer UI figures. For a list of features that are supported you can refer to the following link:
As a workaround, if you need to use any of the features that are not supported, you can use traditional figures inside the App Designer. Note that these figures will not be embedded inside the app. It will instead appear as a popped-out figure.
You can setup your App Designer code to include a button, which when pressed opens up a new traditional figure. For this new figure you can then define your "KeyPressFcn" or any other figure callback functions. Here is a small example of using the button-pushed callback function to generate a new traditional figure for which you can then define the "KeyPressFcn".
          % Button pushed function: Button
          function ButtonPushed(app, event)
              figure('KeyPressFcn', @KeyFcn, 'Name', 'Key Press Demo'); % new traditional figure with interactive features
              plot(1:100);
              function KeyFcn(~, ~)
                  plot(100:-1:1);                
              end
          end
0 Commenti
Più risposte (1)
  ILoveMATLAB
      
 il 3 Gen 2019
        As of 2018b, App Designer supports keyboard and mouse callbacks.
From  the 2018b release notes:
"Figure Interactions: Create apps with custom mouse and keyboard interactions using figures created with the uifigure function"
0 Commenti
Vedere anche
Categorie
				Scopri di più su Interactive Control and Callbacks in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

