Control windows from flash?

Is there anyway to program a flash ‘animation’ with keys which would respond to presses of the directional arrows on keyboard (i know how to do this), and then instead of making a character move on screen, send information (keypress) to an underlying program?

I am asking this as i am using a program called logicator to control directional movement of a toy car im making, but would like to use flash as a front end, as it is more aesthetically pleasing.

Thanks in advance.