I have resently started using app designer in matlab to make small programs but I'm running into a problem.
I have a app with a start button on when the user presses the start button I want to disable button and then count keypresses for a set time. After that i want to enable the button again. But when I disable the button the keypresses are no longer detected.
My current code (simplified)
function StartButtonPushed(app, event)
app.StartButton.Enable = false;
app.awatingResponse = true;
pause(20);
app.StartButton.Enable = true;
end
function UIFigureWindowKeyPress(app, event)
if strcmp(event.Key, 'control') % only counting the control key now
disp('ctrl pressed') % just for testing
end
end
if I remove app.StartButton.Enable = false;
everything works but if it is there nothing happens when pressing ctrl