Пример #1
0
        /// <inheritdoc />
        public virtual void Log(Pointer pointer, PointerEvent evt)
        {
            var id = checkId(pointer);

            var list = getPointerList(id);
            var log  = new PointerLog()
            {
                Id        = eventCount,
                Tick      = DateTime.Now.Ticks,
                PointerId = id,
                Event     = evt,
                State     = new PointerState()
                {
                    Buttons          = pointer.Buttons,
                    Position         = pointer.Position,
                    PreviousPosition = pointer.PreviousPosition,
                    Flags            = pointer.Flags,
                    Target           = pointer.GetPressData().Target,
                    TargetPath       = TransformUtils.GetHeirarchyPath(pointer.GetPressData().Target),
                }
            };

            list.Add(log);
            eventCount++;
        }
Пример #2
0
        /// <inheritdoc />
        public void Log(Pointer pointer, PointerEvent evt)
        {
            var path = TransformUtils.GetHeirarchyPath(pointer.GetPressData().Target);

            writer.Write((uint)pointer.Type);
            writer.Write(eventCount);
            writer.Write(DateTime.Now.Ticks);
            writer.Write(pointer.Id);
            writer.Write((uint)evt);
            writer.Write((uint)pointer.Buttons);
            writer.Write(pointer.Position.x);
            writer.Write(pointer.Position.y);
            writer.Write(pointer.PreviousPosition.x);
            writer.Write(pointer.PreviousPosition.y);
            writer.Write(pointer.Flags);
            writer.Write(path ?? "");

            eventCount++;
        }