Keyboard Output in MATLAB
3 views (last 30 days)
Show older comments
hi
i want to know if i can write a program in MATLAB to tell my PC that a button of its keyboard is pressed.
for example when that program runs ,the button " a " is pressed 3 times each 2 seconds.
0 Comments
Accepted Answer
More Answers (2)
Jan
on 19 Nov 2011
A platform independent method is FEX: inputEmu. This is based on Java and explained on undocumented: gui-automation and undocumented automation-robot
2 Comments
Jan
on 20 Nov 2011
@Sasan: The shown links contain a full description of the usage of the Java Robot. The inputEmu is a Matlab wrapper for the Java Robot also and it contains enough help text. I'm surprised that Walter's short answer solves your problem already.
Sasan Ardaneh
on 20 Nov 2011
1 Comment
Walter Roberson
on 20 Nov 2011
Yes, that looks appropriate. I am pleased to see that you put in the keyRelease event, as it is common for people to think that only the keyPress is needed.
See Also
Categories
Find more on Desktop in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!