can you use java to send keyboard input to another application? for example, write a java program that could open notepad, "type" text, save, then close notepad? what i'm trying to do is make a bot/macro/whatever-its-called to play a gameboy emulator. my friend and i thought it would be cool to see if/how we could write something like this. if this cant be done with java in anyway (i feel thats likely) then does anyone know any means of doing this? thanks for any help!
wow! thanks! im having a little trouble closing the application though, the alt+f4 part doesnt want to work for me, the program just stops and says "interrupted!". could you help me out?
edit: sorry, i fixed it by replacing the alt+f4 part with a p.destroy(); [ April 27, 2007: Message edited by: Micah Pezdirtz ]
posted 11 years ago
ok, sorry to bother you guys again, but i ran into something(but it might not be javas fault) after my program starts the application, an emulator, and loads the gamefile, i tell it to start pressing up, or
however, this does notmake anything really happen. i know its getting the key "pressed", but the emulator isnt receiving the input. VK_UP is definitely the key that is used by the emulator, so why cant the emulator get the input correctly? anyone know?