     listenerStack.forEach (listener)=>
       listener.apply @, args
 
-  on : (event, callback) ->
-    @_e[event] ?= []
-    @_e[event].push callback
+  on  :(event, callback) -> _on  @_e, event, callback
+  off :(event, callback) -> _off @_e, event, callback
+  unsubscribe:(event, callback) -> _off @_e, event, callback
 
-  off : (event) ->
-    if event is "*" then @_e = {} else @_e[event] = []
-
-  unsubscribe: (event, callback) ->
-    if @_e[event]
-      index = @_e[event].indexOf callback
-      if index > -1
-        # log "removed event:#{event} from subscribe list"
-        @_e[event].splice index, 1
-
-  once: (event, callback) ->
+  once:(event, callback) ->
     _callback = () =>
       args = [].slice.call arguments
       @unsubscribe event, _callback

#
# KDEventEmitter
# author : devrim - 12/27/2011
# refactored : sinan - 05/2012

class KDEventEmitter
  @KDEventEmitterEvents = {}

  _e = @KDEventEmitterEvents[@name] = {}                                  # listeners will be put inside @KDEventEmitterEvents[className]

  getEventParser = (event)->

    ///^
    #{event.replace(/\./g,'\\.').replace(/\*/g, '((?:\\w+\\.?)*)')}
    $///
  #
  # STATIC METHODS
  #####################

  #

  @emit : ->
    # slice the arguments, 1st argument is the event name,
    # rest is args supplied with emit.
    [event, args...] = [].slice.call arguments
    # create listener container if it doesn't exist
    _e[event] ?= []
    # call every listener inside the container with the arguments (args)
    listener.apply null,args for listener in _e[event] if _e[event]?

  @on   :(event,callback)->  _on _e, event, callback
  @off  :(event, callback)-> _off _e, event, callback

  constructor:->
    @KDEventEmitterEvents  = {}
    @_e = @KDEventEmitterEvents[@constructor.name] = {}

  emit:(event, args...)->
    @_e[event] ?= []

    listenerStack = []
