samedi 28 mars 2015

execute events read from JSON

I am reading two things from a JSON file:



actionOnPress:"robot.KeyPress(e)"


(robot being a java.awt.robot instance) and



event:"KeyEvent.VK_4"


I want to execute



robot.KeyPress(KeyEvent.VK_4)


what is the easiest way (best without needing to download libraries) to execute this? This code is supposed to also work with robot.mousePress and robot.mouseMove etc.


I already tried different things with ScriptEngine, but none of it seems to work.


Thank you very much, Kamik423


EDIT: should be universal. The user should be able to specify different events like FOR EXAMPLE robot


Aucun commentaire:

Enregistrer un commentaire