ginput Right-double-click

2 次查看(过去 30 天)
Brig
Brig 2012-5-10
So I've created a GUI that allows you to sync data to a video and mark specific points on the data that correspond to moments on the video. I'm having an issue with ginput() that is fairly odd. When I left click, it rolls back the video (expected). When I right click, the video goes foreword (expected). If I add in an
elseif button == 0
disp('works correctly')
it does whatever it's supposed to when a left-double-click occurs. But when I try to go foreword multiple times very quickly by right clicking (double-click speed) it rolls the video backward.
As far as I know there is no right-double-click option for ginput, but it seems like that's what's happening.
[~,y,button] = ginput(1);
if isempty(button)
return
end
while button ~= 2
change = (y - yLim(1))/(yLim(2) - yLim(1));
if button == 1
PlayerWindow.controls.currentPosition = PlayerWindow.controls.currentPosition - change;
elseif button == 3
PlayerWindow.controls.currentPosition = PlayerWindow.controls.currentPosition + change;
elseif isempty(button)
return
end
[~,y,button] = ginput(1);
% get next input
end
end
I realize it could also be an issue with the ActiveX controls I'm using for the video player, but I can't think of why.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by