 
     view.drag event, delta
 
+
   getKeyView:-> @keyView
+
 
   key:(event)->
     @emit event.type, event
     @keyView?.handleEvent event
+
 
   registerWindowResizeListener:(instance)->
     @windowResizeListeners[instance.id] = instance
     instance.on "KDObjectWillBeDestroyed", =>
       @windowResizeListeners[instance.id] = null
 
+
   unregisterWindowResizeListener:(instance)->
     @windowResizeListeners[instance.id] = null
+
 
   notifyWindowResizeListeners: (event)->
     event or= type : "resize"

    window.onfocus = @bound 'focusChange'
    window.onblur  = @bound 'focusChange'

  addUnloadListener:(key, listener)->
    @unloadListeners[key] or= []
    @unloadListeners[key].push listener

  clearUnloadListeners: (key)->

    if key

$                  = require 'jquery'
KD                 = require './kd'
KDKeyboardListener = require './keyboard/listener'
KDKeyboardMap      = require './keyboard/map'
KDController       = require './controller'

###
todo:

  - make addLayer implementation more clear, by default adding a layer
    should set a listener for next ReceivedClickElsewhere and remove the layer automatically
    2012/5/21 Sinan
  - do not self-invoke (:293) -og

###


module.exports = class KDWindowController extends KDController

