Multiple forms with hotkeys interfering

I encountered a problem with a multiview and forms in two different views. Both forms have hotkeys. There seem to be some problems with my implementation.

Ignoring the multiview, I created a snippet with two forms. Each has a hotkey attached to it, yet, they both trigger the submit-action for both forms, instead of just for the form it is in.
http://webix.com/snippet/80c10af4

Is there a best practice for using hotkeys when having multiple forms? The end result should be that only the submit-action from the active form is triggered.

Hotkeys do not depend on visibility or active state. Once attached, handler will fire if the related key is pressed anywhere in the app.

As quick workaround you can have a check in the handler, similar to follows

function handleKey(){
   //run logic only if related control is visible
   if (this.isVisible()) do_some();
}

Ah, thank you. That makes sense.
Because I had another problem concerning these hotkeys, I eventually just added my own hotkey handlers to the input fields where I wanted them. This gave me more control to remove them when needed.