|
"ds " <ds@ds.com> wrote in message <hh89ic$7q8$1@fred.mathworks.com>...
> "Husam Aldahiyat" <numandina@gmail.com> wrote in message <hh88tn$qmb$1@fred.mathworks.com>...
> > Hello,
> > I want MATLAB to "press" certain letters on the keyboard, similar to how it can move the mouse cursor. How can this be done? Perhaps using some secret Java getaround?
>
> The awt.java.robot is handy for pushing buttons, just be careful.
Hey it worked!!!
robot = java.awt.Robot;
lett = 'THANKS';
for k = 1:length(lett)
eval(['robot.keyPress(java.awt.event.KeyEvent.VK_',lett(k),')'])
end
I'm using Java with eval() :)
|