Пример #1
0
        public MouseEvent(string type = "", MouseEventInit mouseEventInitDict = null)
            : base(type, mouseEventInitDict)
        {
            if (mouseEventInitDict == null)
                mouseEventInitDict = new MouseEventInit();

            screenX = mouseEventInitDict.screenX;
            screenY = mouseEventInitDict.screenY;
            clientX = mouseEventInitDict.clientX;
            clientY = mouseEventInitDict.clientY;
            ctrlKey = mouseEventInitDict.ctrlKey;
            shiftKey = mouseEventInitDict.shiftKey;
            altKey = mouseEventInitDict.altKey;
            metaKey = mouseEventInitDict.metaKey;
            button = mouseEventInitDict.button;
            relatedTarget = mouseEventInitDict.relatedTarget;
        }
Пример #2
0
        public MouseEvent(string type = "", MouseEventInit mouseEventInitDict = null)
            : base(type, mouseEventInitDict)
        {
            if (mouseEventInitDict == null)
            {
                mouseEventInitDict = new MouseEventInit();
            }

            screenX       = mouseEventInitDict.screenX;
            screenY       = mouseEventInitDict.screenY;
            clientX       = mouseEventInitDict.clientX;
            clientY       = mouseEventInitDict.clientY;
            ctrlKey       = mouseEventInitDict.ctrlKey;
            shiftKey      = mouseEventInitDict.shiftKey;
            altKey        = mouseEventInitDict.altKey;
            metaKey       = mouseEventInitDict.metaKey;
            button        = mouseEventInitDict.button;
            relatedTarget = mouseEventInitDict.relatedTarget;
        }
Пример #3
0
        internal static bool fire_synthetic_mouse_event(EventName eventName, Node target, bool not_trusted_flag = false)
        {/* Docs: https://html.spec.whatwg.org/multipage/webappapis.html#fire-a-synthetic-mouse-event */
         /* 1) Initialize event's ctrlKey, shiftKey, altKey, and metaKey attributes according to the current state of the key input device, if any (false for any keys that are not available). */
         /* XXX: Implement abstracted method for getting key states, possibly from end-user supplied Document object? */

            MouseEventInit eventInit = new MouseEventInit(0, 0, 0, 0, EMouseButton.Left, EMouseButtonFlags.Left, target)
            {
                bubbles    = true,
                cancelable = true,
            };

            MouseEvent @event = create_event <MouseEvent>(eventName, eventInit);

            @event.View   = target.ownerDocument.defaultView;
            @event.Flags |= EEventFlags.Composed;
            if (not_trusted_flag)
            {
                @event.isTrusted = false;
            }

            return(dispatch_event_to_target(@event, target));
        }
Пример #4
0
 public MouseEvent(string type, MouseEventInit eventInit)
 {
 }
Пример #5
0
 public MouseEvent(string type, MouseEventInit eventInit)
 {
 }