After using the hotkey(escape button) in the window, the window want to be closed

Hi Webix Team

1.Here our requirement is, after using the hotkey(escape button)in the window, the window want to be close.
2.present process is after clicking datatable the window will be come.
3. In that window if we use escape button the window want to be closed.

For reference code,

webix.ui({
  id: "table",
  view:"datatable",
  columns:[
    { id:"rank",	header:"", css:"rank",  		width:50},
    { id:"title",	header:"Film title",fillspace: true},
    { id:"year",	header:"Released" , width:100},
    { id:"votes",	header:"Votes", 	width:100}    
  ],
  autoheight:true,
  data: [
    { id:1, title:"The Shawshank Redemption", year:1994, votes:678790, rating:9.2, rank:1},
    { id:2, title:"The Godfather", year:1972, votes:511495, rating:9.2, rank:2}
  ],
  on:{
    onItemClick:function(id){
        this.setCursor(id);
        $$("editor").getHead().define("template","Title: "+this.getItem(id).title);
        $$("editor").show();
    }  
  }
});	

webix.ui({
  id: "editor",
  view: "window",
  position: "center",
  modal: true,
  head:"Title",
  body:{
     view: "form",
     id: "editor-form",
     elements:[
       {view: "text", name:"year", label: "Year"},
       {view: "text", name:"rating", label: "Rating"},
       {view: "button", label: "Save", type:"form", click: function(){
          $$("editor-form").save();
          $$("editor").hide();
       }}
     ]
  }
});
$$("editor-form").bind("table");

Thanks in advance

Regards
Deepak

Hi webix Team

    var window = {
  view:"window", modal:true, id:"my-win",position:"center", css:"bradius",
    head: { height:38, template: "MyWin" },
  	body : { template:"test", height:200 }

};


webix.UIManager.addHotKey("esc", function(view){
  if (view){
    var top = view.getTopParentView();
    if (top && top.setPosition)
      top.hide();
  }
});



webix.ui(window);
$$('my-win').show();

Regards
Deepak