require.def("ace/lib/event", ["ace/lib/core"], function(core) {

    var event = {};

    event.addListener = function(elem, type, callback) {
        if (elem.addEventListener) {
            return elem.addEventListener(type, callback, false);
        }
        if (elem.attachEvent) {
            var wrapper = function() {
                callback(window.event);
            };
            callback.$$wrapper = wrapper;
            elem.attachEvent("on" + type, wrapper);
        }
    };

    event.removeListener = function(elem, type, callback) {
        if (elem.removeEventListener) {
            return elem.removeEventListener(type, callback, false);
        }
        if (elem.detachEvent) {
            elem.detachEvent("on" + type, callback.$$wrapper || callback);
        }
    };

    event.stopEvent = function(e) {
        event.stopPropagation(e);
        event.preventDefault(e);
        return false;
    };

    event.stopPropagation = function(e) {
        if (e.stopPropagation)
            e.stopPropagation();
        else
            e.cancelBubble = true;
    };

    event.preventDefault = function(e) {
        if (e.preventDefault)
            e.preventDefault();
        else
            e.returnValue = false;
    };

    event.getDocumentX = function(event) {
        if (event.clientX) {
            var doc = event.target.ownerDocument;
            var scrollLeft = doc.documentElement.scrollLeft || doc.body.scrollLeft;
            return event.clientX + scrollLeft;
        } else {
            return event.pageX;
        }
    };

    event.getDocumentY = function(event) {
        if (event.clientY) {
            var doc = event.target.ownerDocument;
            var scrollTop = doc.documentElement.scrollTop || doc.body.scrollTop;
            return event.clientY + scrollTop;
        } else {
            return event.pageX;
        }
    };

    if (document.documentElement.setCapture) {
        event.capture = function(el, eventHandler, releaseCaptureHandler) {
            function onMouseMove(e) {
                eventHandler(e);
                return event.stopPropagation(e);
            }

            function onReleaseCapture(e) {
                eventHandler && eventHandler(e);
                releaseCaptureHandler && releaseCaptureHandler();

                event.removeListener(el, "mousemove", eventHandler);
                event.removeListener(el, "mouseup", onReleaseCapture);
                event.removeListener(el, "losecapture", onReleaseCapture);

                el.releaseCapture();
            }

            event.addListener(el, "mousemove", eventHandler);
            event.addListener(el, "mouseup", onReleaseCapture);
            event.addListener(el, "losecapture", onReleaseCapture);
            el.setCapture();
        };
    }
    else {
        event.capture = function(el, eventHandler, releaseCaptureHandler) {
            function onMouseMove(e) {
                eventHandler(e);
                e.stopPropagation();
            }

            function onMouseUp(e) {
                eventHandler && eventHandler(e);
                releaseCaptureHandler && releaseCaptureHandler();

                document.removeEventListener("mousemove", onMouseMove, true);
                document.removeEventListener("mouseup", onMouseUp, true);

                e.stopPropagation();
            }

            document.addEventListener("mousemove", onMouseMove, true);
            document.addEventListener("mouseup", onMouseUp, true);
        };
    }

    event.addMouseWheelListener = function(el, callback) {
        var listener = function(e) {
            if (e.wheelDelta !== undefined) {
                if (e.wheelDeltaX !== undefined) {
                    e.wheelX = e.wheelDeltaX / 8;
                    e.wheelY = e.wheelDeltaY / 8;
                } else {
                    e.wheelX = 0;
                    e.wheelY = e.wheelDelta / 8;
                }
            }
            else {
                if (e.axis && e.axis == e.HORIZONTAL_AXIS) {
                    e.wheelX = (e.detail || 0) * 5;
                    e.wheelY = 0;
                } else {
                    e.wheelX = 0;
                    e.wheelY = (e.detail || 0) * 5;
                }
            }
            callback(e);
        };
        event.addListener(el, "DOMMouseScroll", listener);
        event.addListener(el, "mousewheel", listener);
    };

    event.addMultiMouseDownListener = function(el, count, timeout, callback) {
        var clicks = 0;
        var startX, startY;

        var listener = function(e) {
           clicks += 1;
           if (clicks == 1) {
               startX = e.clientX;
               startY = e.clientY;

               setTimeout(function() {
                   clicks = 0;
               }, timeout || 600);
           }

           if (Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5)
               clicks = 0;

           if (clicks == count) {
               clicks = 0;
               callback(e);
           }
           return event.preventDefault(e);
        };

        event.addListener(el, "mousedown", listener);
        core.isIE && event.addListener(el, "dblclick", listener);
    };

    event.addKeyListener = function(el, callback) {
      var lastDown = null;

      event.addListener(el, "keydown", function(e) {
          lastDown = e.keyIdentifier || e.keyCode;
          return callback(e);
      });

      if (core.isMac) {
          event.addListener(el, "keypress", function(e) {
              var keyId = e.keyIdentifier || e.keyCode;
              if (lastDown !== keyId) {
                  return callback(e);
              } else {
                  lastDown = null;
              }
          });
      }
    };

    return event;
});
@@ -3751,16 +3751,17 @@
 heelX = 
+-
 e.wheelD
@@ -3794,32 +3794,33 @@
      e.wheelY = 
+-
 e.wheelDeltaY / 
@@ -3912,16 +3912,17 @@
 heelY = 
+-
 e.wheelD

fix scroll orientation for webkit based browsers