Constant keyboard capturing

My function should be worked all the time while user presses the button. What is the way to do such a thing in MEL?

The task is to correct a little flyCamera tool. I need the tool to rotate camera with Alt + mouse movement and to move camera forward/backward while A/Z is pressed.

What are your advices?

Thanks, Artem.