Simulate a mouse event based on a corresponding touch event
@param {Object} event A touch event
@param {String} simulatedType The corresponding mouse event
764543
function simulateMouseEvent (event, simulatedType) {

    // Ignore multi-touch events
    if (event.originalEvent.touches.length > 1) {
      return;
    }

    event.preventDefault();

    var touch = event.originalEvent.changedTouches[0],
        simulatedEvent = document.createEvent('MouseEvents');
    
    // Initialize the simulated mouse event using the touch event's coordinates
    simulatedEvent.initMouseEvent(
      simulatedType,    // type
      true,             // bubbles                    
      true,             // cancelable                 
      window,           // view                       
      1,                // detail                     
      touch.screenX,    // screenX                    
      touch.screenY,    // screenY                    
      touch.clientX,    // clientX                    
      touch.clientY,    // clientY                    
      false,            // ctrlKey                    
      false,            // altKey                     
      false,            // shiftKey                   
      false,            // metaKey                    
      0,                // button                     
      null              // relatedTarget              
    );

    // Dispatch the simulated event to the target element
    event.target.dispatchEvent(simulatedEvent);
  }
5423
function TouchMouseInput() {
  Input.apply(this, arguments);

  var handler = this.handler.bind(this);
  this.touch = new TouchInput(this.manager, handler);
  this.mouse = new MouseInput(this.manager, handler);
}
740641
function (event, name, extraData) {
            var target = (event.target) ? event.target : event.srcElement;
            var fakeEvent = aria.DomEvent.getFakeEvent(name, target);
            if (!event.returnValue) {
                fakeEvent.preventDefault();
            }
            if (event.cancelBubble) {
                fakeEvent.stopPropagation();
            }
            fakeEvent.pageX = event.pageX;
            fakeEvent.pageY = event.pageY;
            fakeEvent.clientX = event.clientX;
            fakeEvent.clientY = event.clientY;
            fakeEvent.touches = event.touches;
            fakeEvent.changedTouches = event.changedTouches;
            fakeEvent.isPrimary = event.isPrimary;
            if (this.startData) {
                if (this.startData.time) {
                    fakeEvent.duration = (new Date()).getTime() - this.startData.time;
                }
            }
            if (!extraData) {
                extraData = {};
            }
            extraData.startX = this.startData.positions[0].x;
            extraData.startY = this.startData.positions[0].y;
            var position = ariaTouchEvent.getPositions(event);
            extraData.currentX = position[0].x;
            extraData.currentY = position[0].y;
            fakeEvent.detail = extraData;
            ariaUtilsDelegate.delegate(fakeEvent);
            event.cancelBubble = fakeEvent.hasStopPropagation;
            event.returnValue = !fakeEvent.hasPreventDefault;
            return event.returnValue;
        }
944662
function( event ) {
			jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
		}
278274
function triggerTouch(touches, element, type) {
            var touchlist = [],
                event = document.createEvent('Event');

            event.initEvent('touch' + type, true, true);

            touchlist.identifiedTouch = touchlist.item = function(index) {
                return this[index] || {};
            };

            touches.forEach(function(touch, i) {
                var x = Math.round(touch.x),
                    y = Math.round(touch.y);
                touchlist.push({
                    pageX: x,
                    pageY: y,
                    clientX: x,
                    clientY: y,
                    screenX: x,
                    screenY: y,
                    target: element,
                    identifier: i
                });
            });

            event.touches = (type == 'end') ? [] : touchlist;
            event.targetTouches = (type == 'end') ? [] : touchlist;
            event.changedTouches = touchlist;

            element.dispatchEvent(event);
            config.showAction(touches);
        }
867015
function mousedown(inEvent) {
  if (!this.isEventSimulatedFromTouch_(inEvent)) {
    // TODO(dfreedman) workaround for some elements not sending mouseup
    // http://crbug/149091
    if (POINTER_ID.toString() in this.pointerMap) {
      this.cancel(inEvent);
    }
    const e = prepareEvent(inEvent, this.dispatcher);
    this.pointerMap[POINTER_ID.toString()] = inEvent;
    this.dispatcher.down(e, inEvent);
  }
}
686331
function onTouch(element, eventType, handler) {
    var self = this;

    this.bindDom(element, Hammer.EVENT_TYPES[eventType], function bindDomOnTouch(ev) {
      var sourceEventType = ev.type.toLowerCase();

      // onmouseup, but when touchend has been fired we do nothing.
      // this is for touchdevices which also fire a mouseup on touchend
      if(sourceEventType.match(/mouse/) && touch_triggered) {
        return;
      }

      // mousebutton must be down or a touch event
      else if(sourceEventType.match(/touch/) ||   // touch events are always on screen
        sourceEventType.match(/pointerdown/) || // pointerevents touch
        (sourceEventType.match(/mouse/) && ev.which === 1)   // mouse is pressed
        ) {
        enable_detect = true;
      }

      // mouse isn't pressed
      else if(sourceEventType.match(/mouse/) && !ev.which) {
        enable_detect = false;
      }


      // we are in a touch event, set the touch triggered bool to true,
      // this for the conflicts that may occur on ios and android
      if(sourceEventType.match(/touch|pointer/)) {
        touch_triggered = true;
      }

      // count the total touches on the screen
      var count_touches = 0;

      // when touch has been triggered in this detection session
      // and we are now handling a mouse event, we stop that to prevent conflicts
      if(enable_detect) {
        // update pointerevent
        if(Hammer.HAS_POINTEREVENTS && eventType != Hammer.EVENT_END) {
          count_touches = Hammer.PointerEvent.updatePointer(eventType, ev);
        }
        // touch
        else if(sourceEventType.match(/touch/)) {
          count_touches = ev.touches.length;
        }
        // mouse
        else if(!touch_triggered) {
          count_touches = sourceEventType.match(/up/) ? 0 : 1;
        }

        // if we are in a end event, but when we remove one touch and
        // we still have enough, set eventType to move
        if(count_touches > 0 && eventType == Hammer.EVENT_END) {
          eventType = Hammer.EVENT_MOVE;
        }
        // no touches, force the end event
        else if(!count_touches) {
          eventType = Hammer.EVENT_END;
        }

        // store the last move event
        if(count_touches || last_move_event === null) {
          last_move_event = ev;
        }

        // trigger the handler
        handler.call(Hammer.detection, self.collectEventData(element, eventType, self.getTouchList(last_move_event, eventType), ev));

        // remove pointerevent from list
        if(Hammer.HAS_POINTEREVENTS && eventType == Hammer.EVENT_END) {
          count_touches = Hammer.PointerEvent.updatePointer(eventType, ev);
        }
      }

      // on the end we reset everything
      if(!count_touches) {
        last_move_event = null;
        enable_detect = false;
        touch_triggered = false;
        Hammer.PointerEvent.reset();
      }
    });
  }
253173
function (simulated) {
    // Set `eventQueue` to null before processing it so that we can tell if more
    // events get enqueued while processing.
    var processingEventQueue = eventQueue;
    eventQueue = null;
    if (simulated) {
      forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseSimulated);
    } else {
      forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseTopLevel);
    }
    !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;
    // This would be a good time to rethrow if any of the event handlers threw.
    ReactErrorUtils_1.rethrowCaughtError();
  }
1192122
function createScrollButtonEvent(ctx, type, env = 'mouse') {
  const parent = getRealParent(ctx);

  const endEventName = env == 'mouse' ? 'mouseup' : 'touchend';
  const { step, mousedownStep } = ctx.ops.scrollButton;

  const stepWithDirection = type == 'start' ? -step : step;
  const mousedownStepWithDirection =
    type == 'start' ? -mousedownStep : mousedownStep;
  const ref = requestAnimationFrame(window);

  // bar props: type
  const barType = ctx.type;

  let isMouseDown = false;
  let isMouseout = true;
  let timeoutId;

  function start(e) {
    /* istanbul ignore if */

    if (3 == e.which) {
      return;
    }

    // set class hook
    parent.setClassHook(`cliking${barType}${type}Button`, true);

    e.stopImmediatePropagation();
    e.preventDefault();

    isMouseout = false;

    parent.scrollBy({
      ['d' + ctx.bar.axis.toLowerCase()]: stepWithDirection
    });

    eventCenter(document, endEventName, endPress, false);

    if (env == 'mouse') {
      const elm = ctx.$refs[type];
      eventCenter(elm, 'mouseenter', enter, false);
      eventCenter(elm, 'mouseleave', leave, false);
    }

    clearTimeout(timeoutId);
    timeoutId = setTimeout(() => {
      isMouseDown = true;
      ref(pressing, window);
    }, 500);
  }

  function pressing() {
    if (isMouseDown && !isMouseout) {
      parent.scrollBy(
        {
          ['d' + ctx.bar.axis.toLowerCase()]: mousedownStepWithDirection
        },
        false
      );
      ref(pressing, window);
    }
  }

  function endPress() {
    clearTimeout(timeoutId);
    isMouseDown = false;
    eventCenter(document, endEventName, endPress, false, 'off');
    if (env == 'mouse') {
      const elm = ctx.$refs[type];
      eventCenter(elm, 'mouseenter', enter, false, 'off');
      eventCenter(elm, 'mouseleave', leave, false, 'off');
    }

    parent.setClassHook(`cliking${barType}${type}Button`, false);
  }

  function enter() {
    isMouseout = false;
    pressing();
  }

  function leave() {
    isMouseout = true;
  }

  return start;
}
579711
function mouseover(inEvent) {
  if (!this.isEventSimulatedFromTouch_(inEvent)) {
    const e = prepareEvent(inEvent, this.dispatcher);
    this.dispatcher.enterOver(e, inEvent);
  }
}
1049004
function (event) {
        if (this.hover === true) {
            this.grabOffset.set(event.gameX, event.gameY);
            this.grabOffset.sub(this.pos);
            this.selected = true;
            // don"t propagate the event furthermore
            return false;
        }
    }
226625
function () {
            /*  determine parameters  */
            var params = $cs.params("touch", arguments, {
                name: { pos: 0, req: true, valid: "string" }
            });

            /*  simply force value to same value in order to trigger event  */
            this.value({
                name:     params.name,
                value:    this.value(params.name),
                injected: true,
                force:    true
            });
        }
642116
function mousemove(inEvent) {
  if (!this.isEventSimulatedFromTouch_(inEvent)) {
    const e = prepareEvent(inEvent, this.dispatcher);
    this.dispatcher.move(e, inEvent);
  }
}
929132
function createEvent(type, options) {
  switch (type) {
    case 'dblclick':
    case 'click':
      return createMouseEvent(type, options);
    case 'keydown':
    case 'keyup':
      return createKeyboardEvent(type, options);
  }
}
229497
function(pointerType, ev) {
    if(!ev.pointerType) {
      return false;
    }

    var pt = ev.pointerType,
      types = {};
    types[Hammer.POINTER_MOUSE] = (pt === ev.MSPOINTER_TYPE_MOUSE || pt === Hammer.POINTER_MOUSE);
    types[Hammer.POINTER_TOUCH] = (pt === ev.MSPOINTER_TYPE_TOUCH || pt === Hammer.POINTER_TOUCH);
    types[Hammer.POINTER_PEN] = (pt === ev.MSPOINTER_TYPE_PEN || pt === Hammer.POINTER_PEN);
    return types[pointerType];
  }
125250
function (eventType, eventArgs, defaultFunction) {
		var point = this,
			series = this.series,
			seriesOptions = series.options;

		// load event handlers on demand to save time on mouseover/out
		if (seriesOptions.point.events[eventType] || (point.options && point.options.events && point.options.events[eventType])) {
			this.importEvents();
		}

		// add default handler if in selection mode
		if (eventType === 'click' && seriesOptions.allowPointSelect) {
			defaultFunction = function (event) {
				// Control key is for Windows, meta (= Cmd key) for Mac, Shift for Opera
				point.select(null, event.ctrlKey || event.metaKey || event.shiftKey);
			};
		}

		fireEvent(this, eventType, eventArgs, defaultFunction);
	}
788849
function (element, type, handler) {
        var touches = this._msTouches;
        var cb = function(e) {

            //Don't fire touch moves when mouse isn't down
            if (e.pointerType == e.MSPOINTER_TYPE_MOUSE && e.buttons == 0) {
                return;
            }

            if (touches.length == 1 && touches[0].pageX == e.pageX &&
                    touches[0].pageY == e.pageY) {
                // don't trigger event when pointer has not moved
                return;
            }
            for (var i=0, ii=touches.length; i<ii; ++i) {
                if (touches[i].pointerId == e.pointerId) {
                    touches[i] = e;
                    break;
                }
            }

            e.touches = touches.slice();
            handler(e);
        };

        OpenLayers.Event.observe(element, 'MSPointerMove', cb);
    }