 
     establishData: -> # NOOP. Input service does not take data
 
-    # Remove all events
-    destroy: -> $(options.elementSelector).off(".GE.MouseService")
+    # Remove all event handlers
+    destroy: -> $(options.elementSelector).off(".#{eventNamespace}")
   }
 
 

  options = _.defaults options,
    elementSelector: "#gameCanvas"

  mouse =
    down: false
    position: null

  # Use the KeyboardService event namespace
  $(options.elementSelector).on "mousedown.GE.MouseService mouseup.GE.MouseService mouseup.GE.MouseService mousemove.GE.MouseService mouseleave.GE.MouseService", (event) ->
    # jQuery standardizes the keycode into http://api.jquery.com/event.which/
    switch event.type 
      when "mousedown" then mouse.down = true
      when "mouseup" then mouse.down = false

  options = _.defaults options,
    elementSelector: "#gameCanvas"

  eventNamespace = _.uniqueId("keyboard")

  keysDown = {}

  $(options.elementSelector).on "keydown.#{eventNamespace} keyup.#{eventNamespace} blur.#{eventNamespace}", (event) ->
    # jQuery standardizes the keycode into http://api.jquery.com/event.which/
    switch event.type 
      when "keydown" then keysDown[event.which] = true
      when "keyup" then delete keysDown[event.which]
      when "blur" then keysDown = {} # Lost focus, so will not receive keyup events
      else throw new Error("Unexpected event type")      

  return {
