필터 지우기
필터 지우기

Alt+tab not working

조회 수: 2 (최근 30일)
Animesh
Animesh 2014년 4월 7일
댓글: 大卫 杨 2022년 10월 13일
I want to switch between two windows(tabs minimized to task bar) using matlab..For which I wrote the code
if true
% code
end
import java.awt.Robot;
import java.awt.event.*;
mouse = Robot;
mouse.keyPress (java.awt.event.KeyEvent.VK_ALT);
mouse.keyPress (java.awt.event.KeyEvent.VK_TAB);
mouse.keyRelease (java.awt.event.KeyEvent.VK_TAB);
pause(2);
mouse.keyRelease (java.awt.event.KeyEvent.VK_ALT);
But it doesn't work..It stays as it is..Can anyone help ?? Thanx in advance
  댓글 수: 2
raym
raym 2017년 3월 25일
Have you solved the problem? I also meet this problem. Win8.1 R2016a Dell XPS13
大卫 杨
大卫 杨 2022년 10월 13일
hello,I am from Hirain,Maybe,I can answer your question ,you can have a try :
mouse.keyPress(java.awt.event.InputEvent.VK_ALT);
hope help you

댓글을 달려면 로그인하십시오.

답변 (2개)

Jan
Jan 2014년 4월 7일
This works fine on my Windows7/64 and Matlab 2009a. When I paste this into the command window, the window for changing the front process is opened and the next application is activated.
  댓글 수: 3
Animesh
Animesh 2014년 4월 8일
Could you suggest another method..
Cynthia
Cynthia 2014년 5월 2일
I have the same problem. Also, if I put a pause in the matlab code and switch the window by myself, the matlab code does not move the mouse and do the clicking as it is said in the code. I have tried it in Windows 7 and it works. Have you found a solution for this apart from changing of operating system?

댓글을 달려면 로그인하십시오.


raym
raym 2017년 3월 26일
Yes. indeed on my computer, although press Alt-Tab works, but sendkeys not work.
However, justnow I found that Alt-Esc also could toggle windows, and I use vbs to send keys:
vb=actxserver('wscript.shell'); vb.SendKeys('%{ESCAPE}');
it worked!!

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by