Midi Keyboard as input device for Flash MX2004

Hello,
has anyone ever used a midi keyboard as input device for a flash application?

My planned Flash Project would have to track the keyboard input of a midi as well as a normal keyboard as the input devices will be exchanged during the progress through the application.

Does anyone know how to track midi keyboard input via ActionScript and what features of a midi keyboard can be tracked?

I’d be greatful if anyone could point me into the right direction,
Regards,
midi