while trying to automate keyPress event in a loop, I get the error: "Unrecognized function or variable 'VK_i'
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Syed Bahrez Nadeem
el 8 de Ag. de 2022
Comentada: Voss
el 8 de Ag. de 2022
I am trying to automate/simualte the keyboard to automatically generate/type numbers using the java robot class and I running into the following error: Unrecognized function or variable 'VK_i'. Could someone help. Here is my code snippet:
clc; clear; close all;
import java.awt.Robot;
import java.awt.event.*;
import java.awt.event.KeyEvent;
keybrd = java.awt.Robot; %Create a keyboard object
for i = 1:3
%num = num2str(i);
key = java.awt.event.KeyEvent.VK_i;
keybrd.keyPress(key);
keybrd.keyRelease(key);
end
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Entering Commands en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!