java - Robot and keyPress -


what sort of code need passed javafx robot when using keypress method?

for example, example below enters 1, not a, suppose there mapping somewhere.

robot robot = com.sun.glass.ui.application.getapplication().createrobot(); robot.keypress(((int) 'a'); 

note: javafx robot, not awt one.

codes defined constants in javafx.scene.input.keycode.

with glass robot, can use deprecated method impl_getcode:

robot robot = com.sun.glass.ui.application.getapplication().createrobot(); robot.keypress(keycode.a.impl_getcode()); 

you can use fxrobot, takes keycodes parameters:

fxrobot robot = fxrobotfactory.createrobot(scene); robot.keypress(javafx.scene.input.keycode.a); 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -