Detecting which mouse button is pressed in a UIFigureWindowButtonDown callback
이전 댓글 표시
In App Designer, how how can I detect which mouse button (Left, Right, Middle) was pressed in a UIFigureWindowButtonDownUIFigureWindowButtonDown callback?
댓글 수: 3
Shubham Gupta
2019년 10월 23일
Did you take a look at the following answer?
Andrei Veldman
2019년 10월 23일
Alexander Melin
2022년 7월 19일
The newer (possibly more elegant) solution uses the event information. Using the UIFigure UIFigureWindowButtonDown callback, the event object passed to the callback has information on the source of the event (mouse click), in this case the UIFigure. Then you can directly access the SelectionType property. For example
% Window button down function: UIFigure
function UIFigureWindowButtonDown(app, event)
switch event.Source.SelectionType
case 'normal'
% Do left button stuff
case 'alt'
% Do right button stuff
case 'extend'
% Do center button stuff
end
end
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Develop Apps Programmatically에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!