Azzera filtri
Azzera filtri

'drawfreehand()' not working for lenovo touchscreen in appdesigner

2 visualizzazioni (ultimi 30 giorni)
I'm trying to setup a simple app in appdesigner that will let the user draw using a touchscreen with the drawfreehand() command. However the drawfreehand() command seems to be ignoring input from the touchscreen on my Lenovo X1 Yoga Gen 7, which is odd because I'm able to still click buttons and interact with the rest of the app using the touchscreen.
The app has a draw button, a clear button, and an axis to draw on as seen below.
To call the draw function, the draw button has the following "buttonPushed" callback
function DrawButtonPushed(app, event)
h = drawfreehand(app.UIAxes, 'Closed',0);
h.FaceSelectable = false;
h.HandleVisibility = 'off';
h.InteractionsAllowed = 'none';
h.Smoothing = 0;
h.FaceAlpha = 0;
end
And this seems to work, as long as I'm using the trackpad or a mouse. For some reason when I use the touchscreen with the thinkpad pen nothing happens. What's confusing me however is that if I remove the call to the UIAxes and instead try the following code:
function DrawButtonPushed(app, event)
h = drawfreehand('Closed',0);
h.FaceSelectable = false;
h.HandleVisibility = 'off';
h.InteractionsAllowed = 'none';
h.Smoothing = 0;
h.FaceAlpha = 0;
end
Then a new figure is generated in a seperate window and in that window the touchscreen works fine and I'm able to draw, however I'd prefer to keep the drawings on the same UI axis within the app.
I was curious if anyone else has run into problems with matlab apps working on a touchscreen and might have suggestions.
  2 Commenti
Kevin Holly
Kevin Holly il 6 Dic 2022
I have reproduced the issue. The touchscreen isn't working when axes/uiaxes are place on a uifigure, which App Designer uses. I have reported the issue to our development team.
This does not work:
fig = uifigure
ax = axes(fig)
drawfreehand(ax,'Closed',0);
This does:
fig = figure
ax = axes(fig)
drawfreehand(ax,'Closed',0);
Amal Raj
Amal Raj il 20 Mar 2023
Hi,
I'm reposting your comment as an answer because it may be of assistance to others who are experiencing the same problem.

Accedi per commentare.

Risposte (1)

Amal Raj
Amal Raj il 20 Mar 2023
I have reproduced the issue. The touchscreen isn't working when axes/uiaxes are place on a uifigure, which App Designer uses. I have reported the issue to our development team.
This does not work:
fig = uifigure
ax = axes(fig)
drawfreehand(ax,'Closed',0);
This does:
fig = figure
ax = axes(fig)
drawfreehand(ax,'Closed',0);

Categorie

Scopri di più su Interactive Control and Callbacks in Help Center e File Exchange

Prodotti


Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by