Keypress to another program

4 ビュー (過去 30 日間)
Orestis Stylianou
Orestis Stylianou 2020 年 2 月 16 日
コメント済み: darova 2020 年 2 月 18 日
Hello!
So I have some scripts which are basically a series of multiple pictures. I also have an independent program which can set markers via keypress (1,2,3 etc). What I am searching for is a way when the picture changes to automatically send another marker. Is that thing even possible? Either with matlab or any onther workaround?
P.S. If yes, can it work in a way that the pictures remain in fullscreen or should I use a dual monitor setup?
Thank you!

採用された回答

Orestis Stylianou
Orestis Stylianou 2020 年 2 月 18 日
Hello, thank you for the answer but I ended up with another solution
scrsz = [1 1 1920 1080];
taskimg = figure;
set(taskimg,'Position',scrsz,'Menubar','none',...
'NumberTitle','off');
set(taskimg,'WindowStyle','modal')
pause(30)
image = imread('Pebble1.tif');
large = axes('Parent', taskimg, 'units', 'pixels');
imshow(image, 'Parent', large)
h = actxserver('WScript.Shell');
h.AppActivate('EmotivPro')
h.SendKeys('{1}')
ginput(1)
set(gcf,'WindowStyle','modal')
h.AppActivate('EmotivPro')
h.SendKeys('{1}')
ginput(1)
So after running the script I have 30 seconds (pause(30)) to pin on top the figure window. This is the window pinning program.
  1 件のコメント
darova
darova 2020 年 2 月 18 日
As you wish

サインインしてコメントする。

その他の回答 (1 件)

darova
darova 2020 年 2 月 16 日
What about ButtonDownFcn?
function main
x = linspace(0,10,50);
y = sin(x);
h = plot(x,y,1,1);
set(gca,'buttonDownFcn',@myfunc)
msgbox('click of graph')
function myfunc(~,~)
set(gca,'color',rand(1,3))
end
end

カテゴリ

Help Center および File ExchangeSpecifying Target for Graphics Output についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by