Where did I go wrong

1 次查看(过去 30 天)
nsbd
nsbd 2011-5-6
Hi all
pause(1.5)
import java.awt.Robot;
import java.awt.event.*;
key =Robot ;
handles.n=str2double(get(handles.edit1,'string')) ;
for i=1:handles.n;
key.keyPress (java.awt.event.KeyEvent.VK_Z);
pause(1)
end
once the keyboard is the Z Clicked. but the notebook is working properly. the program is not in the game.
please help me.
(I'm Working guide.)

采纳的回答

Walter Roberson
Walter Roberson 2011-5-6
Which notebook is working properly? What game is being referred to?
I notice that you have not send release events for the keys pressed.
  4 个评论
nsbd
nsbd 2011-5-6
I've tried before.didn't
I tried again I tried again. but again didn't :(
first prog. clicked(12345678) but just (ZZZZZ) I want.
nsbd
nsbd 2011-5-6
new
"pause(1.5)
import java.awt.Robot;
import java.awt.event.*;
key = Robot ;
n=str2double(get(handles.edit1,'string')) ;
for i=1:n;
key.keyPress(java.awt.event.KeyEvent.VK_5);
pause(1.5)
key.keyRelease(java.awt.event.KeyEvent.VK_5);
pause(1.5)
end
"
:) this trying thank you Roberson.
Eror = (handles.n) changed (n)

请先登录,再进行评论。

更多回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by