Where did I go wrong

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일

1 개 추천

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'm speak English is bad :) I'll try again to tell
trying,writing at the, on Knight Online (ZZZZZZZ or Z1Z1Z1 etc)
but the skill box,just 1 click (Z later stop) :(
I hope you understand me
Walter Roberson
Walter Roberson 2011년 5월 6일
You are not sending the release event, so auto-repeat is happening.
for i=1:handles.n
key.keyPress (java.awt.event.KeyEvent.VK_Z);
key.keyRelease(java.awt.event.KeyEvent.VK_Z);
end
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개)

카테고리

도움말 센터File Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by