Exemple #1
0
        public void SendTouchPoint(HidTouchScreenEntryTouch TouchPoint)
        {
            uint InnerOffset = (uint)Marshal.SizeOf(typeof(HidSharedMemHeader));

            IntPtr HidPtr = new IntPtr(Ns.Ram.ToInt64() + (uint)SharedMemOffset + InnerOffset);

            HidTouchScreenHeader OldTouchScreenHeader = (HidTouchScreenHeader)Marshal.PtrToStructure(HidPtr, typeof(HidTouchScreenHeader));

            HidTouchScreenHeader TouchScreenHeader = new HidTouchScreenHeader()
            {
                TimestampTicks = (ulong)Environment.TickCount,
                NumEntries     = (ulong)Hid_Num_Entries,
                MaxEntryIndex  = (ulong)Hid_Num_Entries - 1,
                Timestamp      = (ulong)Environment.TickCount,
                LatestEntry    = OldTouchScreenHeader.LatestEntry < Hid_Num_Entries - 1 ? OldTouchScreenHeader.LatestEntry + 1 : 0
            };

            Marshal.StructureToPtr(TouchScreenHeader, HidPtr, false);

            InnerOffset += (uint)Marshal.SizeOf(typeof(HidTouchScreenHeader))
                           + (uint)((uint)(OldTouchScreenHeader.LatestEntry) * Marshal.SizeOf(typeof(HidTouchScreenEntry)));
            HidPtr = new IntPtr(Ns.Ram.ToInt64() + (uint)SharedMemOffset + InnerOffset);

            HidTouchScreenEntry hidTouchScreenEntry = new HidTouchScreenEntry()
            {
                Header = new HidTouchScreenEntryHeader()
                {
                    Timestamp  = (ulong)Environment.TickCount,
                    NumTouches = 1
                },
                Touches = new HidTouchScreenEntryTouch[16]
            };

            //Only supports single touch
            hidTouchScreenEntry.Touches[0] = TouchPoint;

            Marshal.StructureToPtr(hidTouchScreenEntry, HidPtr, false);
        }
Exemple #2
0
 public void SendTouchScreenEntry(HidTouchScreenEntryTouch TouchPoint)
 {
     Hid.SendTouchPoint(TouchPoint);
 }